mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-12 01:02:27 +08:00
Fixes bug add baseModal | baseForm 组件
This commit is contained in:
@@ -18,19 +18,19 @@ function createConfig(
|
||||
}: { configName: string; config: any; configFileName?: string } = { configName: '', config: {} }
|
||||
) {
|
||||
try {
|
||||
const windowConf = `window.${ configName }`;
|
||||
const windowConf = `window.${configName}`;
|
||||
// Ensure that the variable will not be modified
|
||||
const configStr = `${ windowConf }=${ JSON.stringify(config) };
|
||||
Object.freeze(${ windowConf });
|
||||
Object.defineProperty(window, "${ configName }", {
|
||||
const configStr = `${windowConf}=${JSON.stringify(config)};
|
||||
Object.freeze(${windowConf});
|
||||
Object.defineProperty(window, "${configName}", {
|
||||
configurable: false,
|
||||
writable: false,
|
||||
});
|
||||
`.replace(/\s/g, '');
|
||||
fs.mkdirp(getRootPath(OUTPUT_DIR));
|
||||
writeFileSync(getRootPath(`${ OUTPUT_DIR }/${ configFileName }`), configStr);
|
||||
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
|
||||
|
||||
console.log(chalk.cyan(`✨ [${ pkg.name }]`) + ` - configuration file is build successfully:`);
|
||||
console.log(chalk.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
|
||||
console.log(chalk.gray(OUTPUT_DIR + '/' + chalk.green(configFileName)) + '\n');
|
||||
} catch (error) {
|
||||
console.log(chalk.red('configuration file configuration file failed to package:\n' + error));
|
||||
|
||||
@@ -14,7 +14,7 @@ export const runBuild = async () => {
|
||||
await runBuildConfig();
|
||||
}
|
||||
|
||||
console.log(`✨ ${ chalk.cyan(`[${ pkg.name }]`) }` + ' - build successfully!');
|
||||
console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
|
||||
} catch (error) {
|
||||
console.log(chalk.red('vite build error:\n' + error));
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user