swico 1.3.0-beta.9 → 1.3.1
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 +7 -11
package/package.json
CHANGED
package/src/command/start.js
CHANGED
|
@@ -106,9 +106,7 @@ var handleWatch = function (projectPath, devServer, env) {
|
|
|
106
106
|
var replaceIndexText, _a;
|
|
107
107
|
return __generator(this, function (_b) {
|
|
108
108
|
switch (_b.label) {
|
|
109
|
-
case 0:
|
|
110
|
-
console.log('eventName', eventName, filePath);
|
|
111
|
-
return [4, fs_extra_1.default.readFile(path_1.default.resolve(projectPath, "./src/.swico".concat(envPath, "index.js")), 'utf8')];
|
|
109
|
+
case 0: return [4, fs_extra_1.default.readFile(path_1.default.resolve(projectPath, "./src/.swico".concat(envPath, "index.js")), 'utf8')];
|
|
112
110
|
case 1:
|
|
113
111
|
replaceIndexText = _b.sent();
|
|
114
112
|
if (!['add', 'unlink'].includes(eventName)) return [3, 9];
|
|
@@ -119,9 +117,7 @@ var handleWatch = function (projectPath, devServer, env) {
|
|
|
119
117
|
case filePath === loadingFilePath: return [3, 7];
|
|
120
118
|
}
|
|
121
119
|
return [3, 9];
|
|
122
|
-
case 2:
|
|
123
|
-
console.log('1');
|
|
124
|
-
return [4, devServer.stop()];
|
|
120
|
+
case 2: return [4, devServer.stop()];
|
|
125
121
|
case 3:
|
|
126
122
|
_b.sent();
|
|
127
123
|
return [4, tsTypingsWatcher.close()];
|
|
@@ -130,14 +126,12 @@ var handleWatch = function (projectPath, devServer, env) {
|
|
|
130
126
|
restartServer();
|
|
131
127
|
return [3, 9];
|
|
132
128
|
case 5:
|
|
133
|
-
console.log('2');
|
|
134
129
|
replaceIndexText = (0, config_1.handleGlobalStyleFile)(replaceIndexText);
|
|
135
130
|
return [4, (0, config_1.updateIndexFileText)(envPath, replaceIndexText)];
|
|
136
131
|
case 6:
|
|
137
132
|
_b.sent();
|
|
138
133
|
return [3, 9];
|
|
139
134
|
case 7:
|
|
140
|
-
console.log('3');
|
|
141
135
|
replaceIndexText = (0, config_1.handleLoadingFile)(replaceIndexText, envPath);
|
|
142
136
|
return [4, (0, config_1.updateIndexFileText)(envPath, replaceIndexText)];
|
|
143
137
|
case 8:
|
|
@@ -202,7 +196,7 @@ var createCompileListener = function (compiler) {
|
|
|
202
196
|
function start() {
|
|
203
197
|
var _a, _b, _c, _d, _e, _f;
|
|
204
198
|
return __awaiter(this, void 0, void 0, function () {
|
|
205
|
-
var availablePort, _g, projectConfig, projectPath, customConfig, env, newRouterBase, startConfig, compiler, oriLogger, devServer, e_1,
|
|
199
|
+
var availablePort, _g, projectConfig, projectPath, customConfig, env, newRouterBase, startConfig, compiler, oriLogger, devServer, e_1, strErr_1;
|
|
206
200
|
return __generator(this, function (_h) {
|
|
207
201
|
switch (_h.label) {
|
|
208
202
|
case 0:
|
|
@@ -254,8 +248,10 @@ function start() {
|
|
|
254
248
|
return [3, 10];
|
|
255
249
|
case 9:
|
|
256
250
|
e_1 = _h.sent();
|
|
257
|
-
|
|
258
|
-
|
|
251
|
+
strErr_1 = e_1.toString();
|
|
252
|
+
if (!filterStyleFileList.find(function (item) { return strErr_1.includes(item); })) {
|
|
253
|
+
tools_1.toast.error(strErr_1);
|
|
254
|
+
}
|
|
259
255
|
return [3, 10];
|
|
260
256
|
case 10: return [2];
|
|
261
257
|
}
|