ylyx-cli 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/config.js
CHANGED
|
@@ -86,11 +86,9 @@ function writeIfAllowed(filePath, content, force) {
|
|
|
86
86
|
|
|
87
87
|
function deriveDefaultVariantContent(baseContent, mode) {
|
|
88
88
|
const isDev = mode === 'dev';
|
|
89
|
-
const isProd = mode === 'prod';
|
|
90
89
|
|
|
91
90
|
let content = baseContent || '';
|
|
92
91
|
const devRe = /let\s+isDev\s*=\s*[^;]*;/;
|
|
93
|
-
const prodRe = /let\s+isProd\s*=\s*[^;]*;/;
|
|
94
92
|
|
|
95
93
|
if (devRe.test(content)) {
|
|
96
94
|
content = content.replace(devRe, `let isDev = ${isDev};`);
|
|
@@ -98,11 +96,12 @@ function deriveDefaultVariantContent(baseContent, mode) {
|
|
|
98
96
|
content = `let isDev = ${isDev};\n` + content;
|
|
99
97
|
}
|
|
100
98
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
// isProd 已废弃:prod 使用 isDev=false 表示
|
|
100
|
+
// 删除历史遗留的 isProd 变量与输出字段(若存在)
|
|
101
|
+
content = content.replace(/let\s+isProd\s*=\s*[^;]*;\s*\r?\n?/g, '');
|
|
102
|
+
content = content.replace(/window\.config\.IS_PROD\s*=\s*[^;]*;\s*\r?\n?/g, '');
|
|
103
|
+
// 删除对象形式的 IS_PROD 字段(例如 IS_PROD: isProd,)
|
|
104
|
+
content = content.replace(/^\s*IS_PROD\s*:\s*[^,}]*,?\s*\r?\n?/gm, '');
|
|
106
105
|
|
|
107
106
|
return content;
|
|
108
107
|
}
|
|
@@ -277,7 +276,7 @@ function initConfig(options = {}) {
|
|
|
277
276
|
|
|
278
277
|
const desired = [
|
|
279
278
|
{ name: `pre${devTarget}`, value: 'ylyx config dev' },
|
|
280
|
-
{ name: `post${prodTarget}`, value: 'ylyx config prod' },
|
|
279
|
+
{ name: `post${prodTarget}`, value: 'ylyx config prod && ylyx deploy' },
|
|
281
280
|
];
|
|
282
281
|
|
|
283
282
|
for (const item of desired) {
|
package/package.json
CHANGED