|
|
@@ -32,7 +32,7 @@ const MINI_CONFIGS = {
|
|
|
* 获取构建配置(根据 action 类型动态选择)
|
|
|
*
|
|
|
* 说明:
|
|
|
- * - dev (开发版预览): 使用 development 模式,跳过构建(使用 watch 模式的输出)
|
|
|
+ * - dev (开发版预览): 使用 development 模式,自动构建
|
|
|
* - experience (体验版): 使用 production 模式,自动构建(体验版=生产环境)
|
|
|
* - production (正式版): 使用 production 模式,自动构建
|
|
|
*
|
|
|
@@ -244,14 +244,7 @@ function updatePackageVersion(config, version) {
|
|
|
async function main() {
|
|
|
const args = process.argv.slice(2)
|
|
|
|
|
|
- // 开发版默认跳过构建(使用已有的 watch 模式构建输出)
|
|
|
- // 可以通过 --build 参数强制重新构建
|
|
|
- const forceBuildIndex = args.indexOf('--build')
|
|
|
- const forceBuild = forceBuildIndex !== -1
|
|
|
- if (forceBuild) {
|
|
|
- args.splice(forceBuildIndex, 1)
|
|
|
- }
|
|
|
-
|
|
|
+ // --no-build 参数可以跳过构建(默认会自动构建)
|
|
|
const noBuildIndex = args.indexOf('--no-build')
|
|
|
const noBuild = noBuildIndex !== -1
|
|
|
if (noBuild) {
|
|
|
@@ -260,8 +253,8 @@ async function main() {
|
|
|
|
|
|
const [miniType, action = 'experience'] = args
|
|
|
|
|
|
- // 开发版默认跳过构建(除非指定 --build)
|
|
|
- const shouldSkipBuild = action === 'dev' && !forceBuild
|
|
|
+ // 只有指定 --no-build 时才跳过构建
|
|
|
+ const shouldSkipBuild = noBuild
|
|
|
|
|
|
// 获取构建配置(需要提前获取以便读取版本号)
|
|
|
const config = getBuildConfig(MINI_CONFIGS[miniType], action)
|