swico 1.6.0-beta.1 → 1.6.0-beta.3
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 +10 -3
package/package.json
CHANGED
package/src/utils/config.js
CHANGED
|
@@ -297,11 +297,11 @@ var handleLoadingFile = function (replaceIndexText, envPath) { return __awaiter(
|
|
|
297
297
|
return [4, fs_extra_1.default.access(path_1.default.resolve(projectPath, './src/loading/index.tsx'), fs_extra_1.default.constants.F_OK)];
|
|
298
298
|
case 2:
|
|
299
299
|
_a.sent();
|
|
300
|
-
newReplaceIndexText = newReplaceIndexText.replace('"../loading"', '"
|
|
300
|
+
newReplaceIndexText = newReplaceIndexText.replace('"../loading"', '"../../src/loading"');
|
|
301
301
|
return [3, 4];
|
|
302
302
|
case 3:
|
|
303
303
|
e_1 = _a.sent();
|
|
304
|
-
newReplaceIndexText = newReplaceIndexText.replace('"
|
|
304
|
+
newReplaceIndexText = newReplaceIndexText.replace('"../../src/loading"', '"../loading"');
|
|
305
305
|
return [3, 4];
|
|
306
306
|
case 4: return [2, newReplaceIndexText];
|
|
307
307
|
}
|
|
@@ -313,7 +313,7 @@ var handleGlobalStyleFile = function (replaceIndexText) {
|
|
|
313
313
|
var newReplaceIndexText = replaceIndexText;
|
|
314
314
|
if (styleFilePath) {
|
|
315
315
|
newReplaceIndexText = newReplaceIndexText.replaceAll("require(\"../../global.".concat(styleFileType, "\");"), '');
|
|
316
|
-
newReplaceIndexText = "require(\"
|
|
316
|
+
newReplaceIndexText = "require(\"../../src/global.".concat(styleFileType, "\");\n").concat(replaceIndexText);
|
|
317
317
|
}
|
|
318
318
|
else {
|
|
319
319
|
newReplaceIndexText = newReplaceIndexText.replaceAll(/require\("\.\.\/\.\.\/global.(less|scss|css)"\);/g, '');
|
|
@@ -371,6 +371,13 @@ var initTemplateConfig = function (routerConfig, templateType, env) {
|
|
|
371
371
|
return [4, fs_extra_1.default.writeFile(hooksFilePath, replaceHooksText)];
|
|
372
372
|
case 6:
|
|
373
373
|
_a.sent();
|
|
374
|
+
replaceIndexText = replaceIndexText.replace('require("../../global");', 'require("../../src/global");');
|
|
375
|
+
if (templateType === 'vue') {
|
|
376
|
+
replaceIndexText = replaceIndexText.replace('require("../../layout/Layout")', 'require("../../src/layout/Layout")');
|
|
377
|
+
}
|
|
378
|
+
else if (templateType === 'react') {
|
|
379
|
+
replaceIndexText = replaceIndexText.replace('require("../../layout")', 'require("../../src/layout")');
|
|
380
|
+
}
|
|
374
381
|
replaceIndexText = (0, exports.handleGlobalStyleFile)(replaceIndexText);
|
|
375
382
|
if (!(templateType === 'vue')) return [3, 8];
|
|
376
383
|
replaceIndexText = replaceIndexText.replace('"../Container"', '"../Container.vue"');
|