ghost-portal/scripts/fixupModules.cjs
Jaco d3dd12d577
Add explicit axios dependency (#9179)
* Add explicit axios dependency

* Adjust tsconfig comment
2023-03-15 09:17:51 +02:00

27 lines
752 B
JavaScript

// Copyright 2017-2023 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
const fs = require('fs');
const path = require('path');
const process = require('process');
// incorrect packages without type specifier
const PKG_FIX = [
'@frequency-chain/api-augment',
// we use the ESM path here
'chartjs-plugin-annotation',
// the default export here is ESM
'i18next-browser-languagedetector'
];
PKG_FIX.forEach((f) => {
const full = path.join(process.cwd(), `node_modules/${f}/package.json`);
const json = JSON.parse(fs.readFileSync(full, 'utf8'));
if (!json.type) {
json.type = 'module';
fs.writeFileSync(full, JSON.stringify(json, null, 2));
console.log('Fixed package type::', f);
}
});