swico 1.7.2 → 1.7.3-beta.2
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/command/start.js +10 -9
- package/src/utils/config.js +1 -0
package/package.json
CHANGED
package/src/command/start.js
CHANGED
|
@@ -109,14 +109,14 @@ var handleWatch = function (projectPath, devServer, env) {
|
|
|
109
109
|
case 0: return [4, fs_extra_1.default.readFile(path_1.default.resolve(projectPath, "./.swico".concat(envPath, "index.js")), 'utf8')];
|
|
110
110
|
case 1:
|
|
111
111
|
replaceIndexText = _b.sent();
|
|
112
|
-
if (!['add', 'unlink'].includes(eventName)) return [3,
|
|
112
|
+
if (!['add', 'unlink'].includes(eventName)) return [3, 10];
|
|
113
113
|
_a = true;
|
|
114
114
|
switch (_a) {
|
|
115
115
|
case filePath.endsWith('.d.ts'): return [3, 2];
|
|
116
116
|
case globalStyleFilesPathList.includes(filePath): return [3, 5];
|
|
117
117
|
case filePath === loadingFilePath: return [3, 7];
|
|
118
118
|
}
|
|
119
|
-
return [3,
|
|
119
|
+
return [3, 10];
|
|
120
120
|
case 2: return [4, devServer.stop()];
|
|
121
121
|
case 3:
|
|
122
122
|
_b.sent();
|
|
@@ -124,20 +124,21 @@ var handleWatch = function (projectPath, devServer, env) {
|
|
|
124
124
|
case 4:
|
|
125
125
|
_b.sent();
|
|
126
126
|
restartServer();
|
|
127
|
-
return [3,
|
|
127
|
+
return [3, 10];
|
|
128
128
|
case 5:
|
|
129
129
|
replaceIndexText = (0, config_1.handleGlobalStyleFile)(replaceIndexText);
|
|
130
130
|
return [4, (0, config_1.updateIndexFileText)(envPath, replaceIndexText)];
|
|
131
131
|
case 6:
|
|
132
132
|
_b.sent();
|
|
133
|
-
return [3,
|
|
134
|
-
case 7:
|
|
135
|
-
replaceIndexText = (0, config_1.handleLoadingFile)(replaceIndexText, envPath);
|
|
136
|
-
return [4, (0, config_1.updateIndexFileText)(envPath, replaceIndexText)];
|
|
133
|
+
return [3, 10];
|
|
134
|
+
case 7: return [4, (0, config_1.handleLoadingFile)(replaceIndexText, envPath)];
|
|
137
135
|
case 8:
|
|
136
|
+
replaceIndexText = _b.sent();
|
|
137
|
+
return [4, (0, config_1.updateIndexFileText)(envPath, replaceIndexText)];
|
|
138
|
+
case 9:
|
|
138
139
|
_b.sent();
|
|
139
|
-
_b.label =
|
|
140
|
-
case
|
|
140
|
+
_b.label = 10;
|
|
141
|
+
case 10: return [2];
|
|
141
142
|
}
|
|
142
143
|
});
|
|
143
144
|
}); });
|
package/src/utils/config.js
CHANGED
|
@@ -299,6 +299,7 @@ var handleLoadingFile = function (replaceIndexText, envPath) { return __awaiter(
|
|
|
299
299
|
return [4, fs_extra_1.default.access(path_1.default.resolve(projectPath, './src/loading/index.tsx'), fs_extra_1.default.constants.F_OK)];
|
|
300
300
|
case 2:
|
|
301
301
|
_a.sent();
|
|
302
|
+
newReplaceIndexText = newReplaceIndexText.replace('"../loading"', '"../../src/loading"');
|
|
302
303
|
return [3, 4];
|
|
303
304
|
case 3:
|
|
304
305
|
e_1 = _a.sent();
|