swico 1.2.1-beta.1 → 1.2.1-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swico",
3
- "version": "1.2.1-beta.1",
3
+ "version": "1.2.1-beta.2",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -87,6 +87,36 @@ var handleWatch = function (projectPath, devServer) {
87
87
  }
88
88
  });
89
89
  }); });
90
+ var watchFiles = [
91
+ path_1.default.join(projectPath, '/src/loading/index.tsx'),
92
+ path_1.default.join(projectPath, '/src/global.css'),
93
+ path_1.default.join(projectPath, '/src/global.less'),
94
+ path_1.default.join(projectPath, '/src/global.scss')
95
+ ];
96
+ var tsTypingsWatcher = chokidar_1.default
97
+ .watch([path_1.default.join(projectPath, '/src/**/*')], {
98
+ interval: 500,
99
+ binaryInterval: 500,
100
+ ignoreInitial: true
101
+ })
102
+ .on('all', function (eventName, path, stats) { return __awaiter(void 0, void 0, void 0, function () {
103
+ return __generator(this, function (_a) {
104
+ switch (_a.label) {
105
+ case 0:
106
+ if (!((watchFiles.includes(path) || path.endsWith('.d.ts')) &&
107
+ ['add'].includes(eventName))) return [3, 3];
108
+ return [4, devServer.stop()];
109
+ case 1:
110
+ _a.sent();
111
+ return [4, tsTypingsWatcher.close()];
112
+ case 2:
113
+ _a.sent();
114
+ restartServer();
115
+ _a.label = 3;
116
+ case 3: return [2];
117
+ }
118
+ });
119
+ }); });
90
120
  };
91
121
  var restartServer = function () {
92
122
  var result = cross_spawn_1.default.sync('cross-env', [
@@ -125,14 +125,7 @@ function default_1(options) {
125
125
  static: {
126
126
  directory: path_1.default.join(projectPath, '/public')
127
127
  },
128
- server: customConfig.dev.https === true ? 'https' : 'http',
129
- watchFiles: [
130
- path_1.default.join(projectPath, '/src/**/*.d.ts'),
131
- path_1.default.join(projectPath, '/src/loading/index.tsx'),
132
- path_1.default.join(projectPath, '/src/global.css'),
133
- path_1.default.join(projectPath, '/src/global.less'),
134
- path_1.default.join(projectPath, '/src/global.scss')
135
- ]
128
+ server: customConfig.dev.https === true ? 'https' : 'http'
136
129
  },
137
130
  plugins: __spreadArray([
138
131
  new fork_ts_checker_webpack_plugin_1.default({