mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
18 lines
546 B
JavaScript
18 lines
546 B
JavaScript
const { join } = require('path');
|
|
const { readFileSync, writeFileSync } = require('fs');
|
|
|
|
const filePath = join(__dirname, '../packages/nodecore/dist/defineConfig.d.ts');
|
|
|
|
const content = readFileSync(filePath, 'utf-8');
|
|
const toReplace = `import { IConfigFromPlugins } from '@@/core/pluginConfig';`;
|
|
const tsIgnore = `// @ts-ignore`;
|
|
|
|
if (content.indexOf(toReplace) === -1) {
|
|
throw new Error('ts ignore add failed since target not found.');
|
|
}
|
|
writeFileSync(
|
|
filePath,
|
|
content.replace(toReplace, `${tsIgnore}\n${toReplace}`),
|
|
'utf-8',
|
|
);
|