fix: cli generate platform issue (#859)

1. 修复生成的平台模板仍然使用 useResourceAlias 配置的 bug
2. 修复生成的 package.json 未格式化的 bug
This commit is contained in:
chilingling 2024-10-14 18:16:34 -07:00 committed by GitHub
parent a50825514e
commit 0e8dc1faaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -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`)

View File

@ -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'
})