swico 2.1.0-beta.7 → 2.1.0-beta.8

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": "2.1.0-beta.7",
3
+ "version": "2.1.0-beta.8",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "author": "scw",
30
30
  "license": "ISC",
31
31
  "dependencies": {
32
- "@rspack/dev-server": "1.1.1",
32
+ "@rspack/dev-server": "1.1.3",
33
33
  "@vue/compiler-sfc": "3.5.13",
34
34
  "chalk": "4.1.2",
35
35
  "chokidar": "3.6.0",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@eslint/js": "9.24.0",
63
- "@rspack/core": "1.3.5",
63
+ "@rspack/core": "1.3.15",
64
64
  "@types/node": "22.13.10",
65
65
  "@types/react": "19.1.0",
66
66
  "@types/react-dom": "19.1.0",
@@ -101,22 +101,25 @@ const getMockGetLogger = (compiler) => {
101
101
  };
102
102
  };
103
103
  const filterStyleFileList = [
104
- 'Can\'t resolve \'../../src/global.less\'',
105
- 'Can\'t resolve \'../../src/global.css\'',
106
- 'Can\'t resolve \'../../src/global.scss\'',
107
- 'Can\'t resolve \'../../src/loading\''
104
+ "Can't resolve '../../src/global.less'",
105
+ "Can't resolve '../../src/global.css'",
106
+ "Can't resolve '../../src/global.scss'",
107
+ "Can't resolve '../../src/loading'"
108
108
  ];
109
109
  const createCompileListener = (compiler) => {
110
+ let now;
110
111
  compiler.hooks.beforeCompile.tap('beforeCompile', () => {
112
+ now = Date.now();
111
113
  tools_1.toast.info('Compiling...');
112
114
  });
113
115
  compiler.hooks.done.tap('done', (stats) => {
114
- const info = stats === null || stats === void 0 ? void 0 : stats.toJson();
115
116
  if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) {
117
+ const info = stats === null || stats === void 0 ? void 0 : stats.toJson();
116
118
  tools_1.toast.error(info === null || info === void 0 ? void 0 : info.errors.map((item) => item.message || item.stack).filter((item1) => !filterStyleFileList.find((item2) => item1.includes(item2))));
117
119
  return;
118
120
  }
119
121
  if (stats === null || stats === void 0 ? void 0 : stats.hasWarnings()) {
122
+ const info = stats === null || stats === void 0 ? void 0 : stats.toJson();
120
123
  const warnings = info.warnings;
121
124
  warnings.some((item) => {
122
125
  const msg = item.message || item.stack;
@@ -126,7 +129,8 @@ const createCompileListener = (compiler) => {
126
129
  }
127
130
  });
128
131
  }
129
- tools_1.toast.info(`Compiled ${(info === null || info === void 0 ? void 0 : info.time) ? `in ${(info.time / 1000).toFixed(2)}s` : ''}`);
132
+ const duration = Date.now() - now;
133
+ tools_1.toast.info(`Compiled ${duration ? `in ${(duration / 1000).toFixed(2)}s` : ''}`);
130
134
  });
131
135
  };
132
136
  function start() {