swico 0.8.2-beta5 → 0.8.2-beta6

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": "0.8.2-beta5",
3
+ "version": "0.8.2-beta6",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -132,6 +132,22 @@ var getMockGetLogger = function (compiler) {
132
132
  return __assign(__assign({}, logger), { log: log, debug: debug, error: error, warn: warn, info: function () { } });
133
133
  };
134
134
  };
135
+ var createCompileListener = function (compiler) {
136
+ compiler.hooks.beforeCompile.tap('beforeCompile', function () {
137
+ tools_1.toast.info('Compiling...', { wrap: false });
138
+ });
139
+ compiler.hooks.done.tap('done', function (stats) {
140
+ var info = stats.toJson();
141
+ if (stats.hasErrors()) {
142
+ tools_1.toast.error(info.errors.map(function (item) { return item.stack; }));
143
+ return;
144
+ }
145
+ if (stats.hasWarnings()) {
146
+ tools_1.toast.warning(info.warnings.map(function (item) { return item.stack; }));
147
+ }
148
+ tools_1.toast.info("Compiled complete in ".concat(info.time, "ms"));
149
+ });
150
+ };
135
151
  function start() {
136
152
  return __awaiter(this, void 0, void 0, function () {
137
153
  var _a, projectConfig, projectPath, startConfig, compiler, oriLogger, devServer, e_1, strErr;
@@ -172,16 +188,7 @@ function start() {
172
188
  return [4, devServer.start()];
173
189
  case 8:
174
190
  _b.sent();
175
- compiler.hooks.beforeCompile.tap('beforeCompile', function () {
176
- tools_1.toast.info('Compiling...', { wrap: false });
177
- });
178
- compiler.hooks.done.tap('done', function (stats) {
179
- var info = stats.toJson();
180
- if (stats.hasErrors() || stats.hasWarnings()) {
181
- return;
182
- }
183
- tools_1.toast.info("Compiled complete in ".concat(info.time, "ms"));
184
- });
191
+ createCompileListener(compiler);
185
192
  compiler.getInfrastructureLogger = oriLogger;
186
193
  handleWatch(projectPath, devServer);
187
194
  tools_1.toast.info("Project is running at\uFF1A".concat(chalk_1.default.hex('#29abe0')("".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"))), { wrap: false });
@@ -129,6 +129,8 @@ function default_1(options) {
129
129
  new eslint_webpack_plugin_1.default({
130
130
  context: path_1.default.join(projectPath, '/src'),
131
131
  extensions: templateType === 'vue' ? ['vue', 'ts', 'js'] : ['tsx', 'ts', 'js'],
132
+ emitError: false,
133
+ emitWarning: false,
132
134
  cache: true
133
135
  })
134
136
  ], ((_e = (_d = customConfig.dev) === null || _d === void 0 ? void 0 : _d.plugins) !== null && _e !== void 0 ? _e : []), true)