swico 3.1.0-beta.7 → 3.1.0
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/main-config/index.js +5 -5
package/package.json
CHANGED
package/src/main-config/index.js
CHANGED
|
@@ -122,25 +122,25 @@ const getProjectConfig = (env) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
122
122
|
supportedFieldList = ['plugins', 'console', 'copy', 'devtool', 'router'];
|
|
123
123
|
configFileName = 'swico.prod.ts';
|
|
124
124
|
}
|
|
125
|
-
const toastTitle = `Swico config file => ${chalk_1.default.hex(utils_1.colorConfig.theme)(configFileName)}`;
|
|
125
|
+
const toastTitle = `Swico config file error => ${chalk_1.default.hex(utils_1.colorConfig.theme)(configFileName)}`;
|
|
126
126
|
const unSupportedField = configFields.find((field) => !supportedFieldList.includes(field));
|
|
127
127
|
if (configFields.length > 0 && unSupportedField) {
|
|
128
|
-
const msgText = `The Swico configuration file '${chalk_1.default.blue(configFileName)}' does not support the field '${chalk_1.default.
|
|
128
|
+
const msgText = `The Swico configuration file '${chalk_1.default.blue(configFileName)}' does not support the field '${chalk_1.default.blue(unSupportedField)}' `;
|
|
129
129
|
utils_1.toast.error(msgText);
|
|
130
130
|
process.exit(1);
|
|
131
131
|
}
|
|
132
132
|
if (key === 'base' &&
|
|
133
133
|
configObj['template'] === 'vue' &&
|
|
134
134
|
configFields.includes('reactCompiler')) {
|
|
135
|
-
utils_1.toast.error(`'${chalk_1.default.blue('vue')}' template does not support the field '${chalk_1.default.
|
|
135
|
+
utils_1.toast.error(`'${chalk_1.default.blue('vue')}' template does not support the field '${chalk_1.default.blue('reactCompiler')}'`, { title: toastTitle });
|
|
136
136
|
process.exit(1);
|
|
137
137
|
}
|
|
138
138
|
if (key === 'base' && !['vue', 'react'].includes(configObj['template'])) {
|
|
139
|
-
utils_1.toast.error(`The field '${chalk_1.default.blue('template')}' does not support the value '${chalk_1.default.
|
|
139
|
+
utils_1.toast.error(`The field '${chalk_1.default.blue('template')}' does not support the value '${chalk_1.default.blue(configObj['template'])}',the value should be 'vue' or 'react' `, { title: toastTitle });
|
|
140
140
|
process.exit(1);
|
|
141
141
|
}
|
|
142
142
|
if (!['hash', 'browser'].includes((_b = (_a = configObj['router']) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : exports.initConfig.router.type)) {
|
|
143
|
-
utils_1.toast.error(`The field '${chalk_1.default.blue('router.type')}' does not support the value '${chalk_1.default.
|
|
143
|
+
utils_1.toast.error(`The field '${chalk_1.default.blue('router.type')}' does not support the value '${chalk_1.default.blue(configObj['router'].type)}',the value should be 'browser' or 'hash' `, { title: toastTitle });
|
|
144
144
|
process.exit(1);
|
|
145
145
|
}
|
|
146
146
|
customConfig[key] = (yield Promise.resolve(`${curConfigFilePath}`).then(s => __importStar(require(s)))).default;
|