|
@@ -1,10 +1,7 @@
|
|
|
-import packageConfig from '../package.json' assert { type: 'json' };
|
|
|
|
|
-import config from '../src/config.json' assert { type: 'json' };
|
|
|
|
|
-import { fileURLToPath } from 'url';
|
|
|
|
|
-import { resolve, dirname } from 'path';
|
|
|
|
|
-const __filename = fileURLToPath(import.meta.url);
|
|
|
|
|
-const __dirname = dirname(__filename);
|
|
|
|
|
-import { outputFile } from 'fs-extra';
|
|
|
|
|
|
|
+const packageConfig = require('../package.json');
|
|
|
|
|
+const config = require('../src/config.json');
|
|
|
|
|
+const path = require('path');
|
|
|
|
|
+const fs = require('fs-extra');
|
|
|
let importStr = `import { App } from 'vue';
|
|
let importStr = `import { App } from 'vue';
|
|
|
import Locale from './locale';\n`;
|
|
import Locale from './locale';\n`;
|
|
|
let importScssStr = `\n`;
|
|
let importScssStr = `\n`;
|
|
@@ -33,7 +30,7 @@ const version = '${packageConfig.version}';
|
|
|
export { install, version, Locale, ${packages.join(',')}};
|
|
export { install, version, Locale, ${packages.join(',')}};
|
|
|
export default { install, version, Locale};`;
|
|
export default { install, version, Locale};`;
|
|
|
|
|
|
|
|
-outputFile(resolve(__dirname, '../src/packages/nutui.vue.build.ts'), fileStrBuild, 'utf8', (error) => {
|
|
|
|
|
|
|
+fs.outputFile(path.resolve(__dirname, '../src/packages/nutui.vue.build.ts'), fileStrBuild, 'utf8', (error) => {
|
|
|
// logger.success(`${package_config_path} 文件写入成功`);
|
|
// logger.success(`${package_config_path} 文件写入成功`);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -43,6 +40,6 @@ ${importScssStr}
|
|
|
export const testComponents = { ${packages.join(',')}};
|
|
export const testComponents = { ${packages.join(',')}};
|
|
|
export { install, Locale, ${packages.join(',')} };
|
|
export { install, Locale, ${packages.join(',')} };
|
|
|
export default { install, version:'${packageConfig.version}', Locale};`;
|
|
export default { install, version:'${packageConfig.version}', Locale};`;
|
|
|
-outputFile(resolve(__dirname, '../src/packages/nutui.vue.ts'), fileStrDev, 'utf8', (error) => {
|
|
|
|
|
|
|
+fs.outputFile(path.resolve(__dirname, '../src/packages/nutui.vue.ts'), fileStrDev, 'utf8', (error) => {
|
|
|
// logger.success(`${package_config_path} 文件写入成功`);
|
|
// logger.success(`${package_config_path} 文件写入成功`);
|
|
|
});
|
|
});
|