From 0e8dc1faaa3e003f36a3e8b930c7985587b348dd Mon Sep 17 00:00:00 2001 From: chilingling <26962197+chilingling@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:16:34 -0700 Subject: [PATCH] fix: cli generate platform issue (#859) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复生成的平台模板仍然使用 useResourceAlias 配置的 bug 2. 修复生成的 package.json 未格式化的 bug --- packages/engine-cli/src/commands/create.js | 2 +- packages/engine-cli/template/designer/vite.config.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/engine-cli/src/commands/create.js b/packages/engine-cli/src/commands/create.js index c8a07323..f0fdb3ab 100644 --- a/packages/engine-cli/src/commands/create.js +++ b/packages/engine-cli/src/commands/create.js @@ -46,7 +46,7 @@ export function createPlatform(name, options = {}) { const pkgContent = generatePackageJson(name, mergedOptions, templatePath) fs.outputFileSync(path.resolve(destPath, 'engine.config.js'), configContent) - fs.outputJSONSync(path.resolve(destPath, 'package.json'), pkgContent) + fs.outputJSONSync(path.resolve(destPath, 'package.json'), pkgContent, { spaces: 2 }) logger.log( chalk.green(`create finish, run the follow command to start project: \ncd ${name} && npm install && npm run dev`) diff --git a/packages/engine-cli/template/designer/vite.config.js b/packages/engine-cli/template/designer/vite.config.js index e6088179..9dd2864e 100644 --- a/packages/engine-cli/template/designer/vite.config.js +++ b/packages/engine-cli/template/designer/vite.config.js @@ -7,7 +7,6 @@ export default defineConfig((configEnv) => { viteConfigEnv: configEnv, root: __dirname, iconDirs: [path.resolve(__dirname, './node_modules/@opentiny/tiny-engine/assets/')], - useSourceAlias: true, envDir: './env' })