swico 0.8.2-beta5 → 0.8.2-beta7

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-beta7",
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,23 @@ 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;
140
+ compiler.hooks.done.tap('done', function (stats) {
141
+ var info = stats.toJson();
142
+ if (stats.hasErrors()) {
143
+ tools_1.toast.error(info.errors.map(function (item) { return item.stack; }));
144
+ return;
145
+ }
146
+ if (stats.hasWarnings()) {
147
+ tools_1.toast.warning(info.warnings.map(function (item) { return item.stack; }));
148
+ }
149
+ tools_1.toast.info("Compiled complete in ".concat(info.time, "ms"));
150
+ });
151
+ };
135
152
  function start() {
136
153
  return __awaiter(this, void 0, void 0, function () {
137
154
  var _a, projectConfig, projectPath, startConfig, compiler, oriLogger, devServer, e_1, strErr;
@@ -172,16 +189,7 @@ function start() {
172
189
  return [4, devServer.start()];
173
190
  case 8:
174
191
  _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
- });
192
+ createCompileListener(compiler);
185
193
  compiler.getInfrastructureLogger = oriLogger;
186
194
  handleWatch(projectPath, devServer);
187
195
  tools_1.toast.info("Project is running at\uFF1A".concat(chalk_1.default.hex('#29abe0')("".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"))), { wrap: false });
@@ -128,7 +128,11 @@ function default_1(options) {
128
128
  plugins: __spreadArray([
129
129
  new eslint_webpack_plugin_1.default({
130
130
  context: path_1.default.join(projectPath, '/src'),
131
+ failOnError: false,
132
+ failOnWarning: false,
131
133
  extensions: templateType === 'vue' ? ['vue', 'ts', 'js'] : ['tsx', 'ts', 'js'],
134
+ emitError: false,
135
+ emitWarning: false,
132
136
  cache: true
133
137
  })
134
138
  ], ((_e = (_d = customConfig.dev) === null || _d === void 0 ? void 0 : _d.plugins) !== null && _e !== void 0 ? _e : []), true)