swico 0.8.4-beta4 → 0.8.4-beta6
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/package.json +1 -1
- package/src/utils/config.js +9 -8
package/package.json
CHANGED
package/src/utils/config.js
CHANGED
|
@@ -93,7 +93,7 @@ var getProjectConfig = function (env) { return __awaiter(void 0, void 0, void 0,
|
|
|
93
93
|
};
|
|
94
94
|
customConfig = {};
|
|
95
95
|
_loop_1 = function (key) {
|
|
96
|
-
var curConfigFilePath, exists, configObj, configFields, supportedFieldList_1, configFileName, unSupportedField, msgText, _f, _g;
|
|
96
|
+
var curConfigFilePath, exists, configObj, configFields, supportedFieldList_1, configFileName, toastTitle, unSupportedField, msgText, _f, _g;
|
|
97
97
|
return __generator(this, function (_h) {
|
|
98
98
|
switch (_h.label) {
|
|
99
99
|
case 0:
|
|
@@ -130,24 +130,25 @@ var getProjectConfig = function (env) { return __awaiter(void 0, void 0, void 0,
|
|
|
130
130
|
supportedFieldList_1 = ['plugins', 'console', 'copy', 'devtool', 'router'];
|
|
131
131
|
configFileName = 'swico.prod.ts';
|
|
132
132
|
}
|
|
133
|
+
toastTitle = "Swico config => ".concat(chalk_1.default.hex(tools_1.colorConfig.theme)(configFileName));
|
|
133
134
|
unSupportedField = configFields.find(function (field) { return !supportedFieldList_1.includes(field); });
|
|
134
135
|
if (configFields.length > 0 && unSupportedField) {
|
|
135
136
|
msgText = "The Swico configuration file '".concat(chalk_1.default.blue(configFileName), "' does not support the field '").concat(chalk_1.default.red(unSupportedField), "' ");
|
|
136
137
|
tools_1.toast.error(msgText);
|
|
137
|
-
process.exit();
|
|
138
|
+
process.exit(1);
|
|
138
139
|
}
|
|
139
140
|
if (key === 'base' && !['vue', 'react'].includes(configObj['template'])) {
|
|
140
|
-
tools_1.toast.error("The field '".concat(chalk_1.default.blue('template'), "' does not support the value '").concat(chalk_1.default.red(configObj['template']), "',the value
|
|
141
|
-
process.exit();
|
|
141
|
+
tools_1.toast.error("The field '".concat(chalk_1.default.blue('template'), "' does not support the value '").concat(chalk_1.default.red(configObj['template']), "',the value should be 'vue' or 'react' "), { title: toastTitle });
|
|
142
|
+
process.exit(1);
|
|
142
143
|
}
|
|
143
144
|
if (key === 'base' &&
|
|
144
145
|
!['npm', 'pnpm'].includes((_b = configObj['npmType']) !== null && _b !== void 0 ? _b : exports.initConfig.npmType)) {
|
|
145
|
-
tools_1.toast.error("The field '".concat(chalk_1.default.blue('npmType'), "' does not support the value '").concat(chalk_1.default.red(configObj['npmType']), "',the value
|
|
146
|
-
process.exit();
|
|
146
|
+
tools_1.toast.error("The field '".concat(chalk_1.default.blue('npmType'), "' does not support the value '").concat(chalk_1.default.red(configObj['npmType']), "',the value should be 'npm' or 'pnpm' "), { title: toastTitle });
|
|
147
|
+
process.exit(1);
|
|
147
148
|
}
|
|
148
149
|
if (!['hash', 'browser'].includes((_d = (_c = configObj['router']) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : exports.initConfig.router.type)) {
|
|
149
|
-
tools_1.toast.error("The field '".concat(chalk_1.default.blue('router.type'), "' does not support the value '").concat(chalk_1.default.red(configObj['router'].type), "',the value
|
|
150
|
-
process.exit();
|
|
150
|
+
tools_1.toast.error("The field '".concat(chalk_1.default.blue('router.type'), "' does not support the value '").concat(chalk_1.default.red(configObj['router'].type), "',the value should be 'browser' or 'hash' "), { title: toastTitle });
|
|
151
|
+
process.exit(1);
|
|
151
152
|
}
|
|
152
153
|
_f = customConfig;
|
|
153
154
|
_g = key;
|