swico 2.1.0-beta.6 → 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.6",
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() {
@@ -35,7 +35,6 @@ function default_1(_a) {
35
35
  };
36
36
  const publicPath = (_b = customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.publicPath) !== null && _b !== void 0 ? _b : config_1.initConfig.publicPath;
37
37
  const routerBase = (_d = (_c = customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.router) === null || _c === void 0 ? void 0 : _c.base) !== null && _d !== void 0 ? _d : config_1.initConfig.router.base;
38
- const cssMode = 'css/auto';
39
38
  const basicPlugins = [];
40
39
  const defineConfigData = (_f = (_e = customConfig === null || customConfig === void 0 ? void 0 : customConfig.base) === null || _e === void 0 ? void 0 : _e.define) !== null && _f !== void 0 ? _f : {};
41
40
  const formatObj = yield (0, config_1.getFormatDefineVars)(defineConfigData);
@@ -96,17 +95,17 @@ function default_1(_a) {
96
95
  oneOf: [
97
96
  {
98
97
  test: /\.css$/,
99
- type: cssMode,
98
+ type: 'css/auto',
100
99
  use: [postcssLoader]
101
100
  },
102
101
  {
103
102
  test: /\.less$/,
104
- type: cssMode,
103
+ type: 'css/auto',
105
104
  use: [postcssLoader, lessLoader]
106
105
  },
107
106
  {
108
107
  test: /\.scss$/,
109
- type: cssMode,
108
+ type: 'css/auto',
110
109
  use: [
111
110
  postcssLoader,
112
111
  {
@@ -29,7 +29,6 @@ export interface GlobalSwicoConfigType {
29
29
  devtool?: string;
30
30
  externals?: any;
31
31
  router?: ConfigRouterType;
32
- cssAuto?: boolean;
33
32
  }
34
33
  export interface GlobalData {
35
34
  templateType?: GlobalSwicoConfigType['template'];
@@ -38,7 +37,7 @@ export interface GlobalData {
38
37
  templatePath: string;
39
38
  env?: 'dev' | 'prod';
40
39
  customConfig: {
41
- base: Pick<GlobalSwicoConfigType, 'plugins' | 'publicPath' | 'alias' | 'define' | 'devtool' | 'externals' | 'router' | 'template' | 'cssAuto'>;
40
+ base: Pick<GlobalSwicoConfigType, 'plugins' | 'publicPath' | 'alias' | 'define' | 'devtool' | 'externals' | 'router' | 'template'>;
42
41
  dev: Pick<GlobalSwicoConfigType, 'plugins' | 'proxy' | 'https' | 'devtool' | 'router'>;
43
42
  prod: Pick<GlobalSwicoConfigType, 'plugins' | 'console' | 'copy' | 'devtool' | 'router'>;
44
43
  };
@@ -77,8 +77,7 @@ const getProjectConfig = (env) => __awaiter(void 0, void 0, void 0, function* ()
77
77
  'devtool',
78
78
  'externals',
79
79
  'router',
80
- 'template',
81
- 'cssAuto'
80
+ 'template'
82
81
  ];
83
82
  configFileName = 'swico.ts';
84
83
  break;
@@ -267,7 +266,6 @@ const getFormatDefineVars = (defineVarsConfigData) => __awaiter(void 0, void 0,
267
266
  exports.getFormatDefineVars = getFormatDefineVars;
268
267
  exports.initConfig = {
269
268
  console: true,
270
- cssAuto: true,
271
269
  plugins: [],
272
270
  publicPath: '/',
273
271
  proxy: undefined,