swico 2.0.0-beta.6 → 2.0.0-beta.7

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.0.0-beta.6",
3
+ "version": "2.0.0-beta.7",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -52,8 +52,8 @@
52
52
  "postcss-preset-env": "9.3.0",
53
53
  "qs": "6.13.0",
54
54
  "react-router-dom": "6.23.0",
55
- "sass": "1.77.5",
56
- "sass-loader": "14.2.1",
55
+ "sass-embedded": "^1.86.3",
56
+ "sass-loader": "16.0.5",
57
57
  "style-loader": "3.3.0",
58
58
  "ts-checker-rspack-plugin": "^1.1.1",
59
59
  "ts-node": "10.9.1",
@@ -35,7 +35,7 @@ const handleWatch = (projectPath, devServer, env) => {
35
35
  ignored: [path_1.default.join(projectPath, '/config/swico.prod.ts')]
36
36
  })
37
37
  .on('all', (path, stats) => __awaiter(void 0, void 0, void 0, function* () {
38
- tools_1.toast.warning('Swico configuration files changed, restarting server...', {
38
+ tools_1.toast.warning('Configuration files changed, restarting server...', {
39
39
  inline: true
40
40
  });
41
41
  yield devServer.stop();
@@ -116,11 +116,10 @@ const createCompileListener = (compiler) => {
116
116
  return;
117
117
  }
118
118
  if (stats === null || stats === void 0 ? void 0 : stats.hasWarnings()) {
119
- console.log('warning', info);
120
119
  const warnings = info.warnings;
121
120
  warnings.some((item) => {
122
121
  const msg = item.message || item.stack;
123
- if (msg.startsWith('[eslint]')) {
122
+ if (msg.includes('[eslint]')) {
124
123
  tools_1.toast.warning(msg, { title: 'ESLint errors' });
125
124
  return;
126
125
  }
@@ -67,7 +67,6 @@ function default_1(options) {
67
67
  compress: true,
68
68
  hot: true,
69
69
  open: false,
70
- liveReload: false,
71
70
  static: {
72
71
  directory: path_1.default.join(projectPath, '/public')
73
72
  },
@@ -4,7 +4,9 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
4
4
  output: {
5
5
  path: string;
6
6
  filename: string;
7
+ chunkFilename: string;
7
8
  cssFilename: string;
9
+ cssChunkFilename: string;
8
10
  assetModuleFilename: string;
9
11
  publicPath: string;
10
12
  clean: boolean;
@@ -58,6 +60,28 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
58
60
  })[];
59
61
  generator?: undefined;
60
62
  loader?: undefined;
63
+ } | {
64
+ test: RegExp;
65
+ type: string;
66
+ use: ({
67
+ loader: string;
68
+ options: {
69
+ postcssOptions: {
70
+ plugins: string[][];
71
+ };
72
+ api?: undefined;
73
+ implementation?: undefined;
74
+ };
75
+ } | {
76
+ loader: string;
77
+ options: {
78
+ api: string;
79
+ implementation: string;
80
+ postcssOptions?: undefined;
81
+ };
82
+ })[];
83
+ generator?: undefined;
84
+ loader?: undefined;
61
85
  } | {
62
86
  test: RegExp;
63
87
  type: string;
@@ -45,8 +45,10 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
45
45
  entry: entryPath,
46
46
  output: {
47
47
  path: path_1.default.join(projectPath, '/dist'),
48
- filename: 'js/[name].[id].js',
48
+ filename: 'js/[name].[chunkhash].js',
49
+ chunkFilename: 'js/[name].[chunkhash].js',
49
50
  cssFilename: 'css/[name].[contenthash].css',
51
+ cssChunkFilename: 'css/[name].[contenthash].css',
50
52
  assetModuleFilename: 'assets/[name]_[chunkhash][ext]',
51
53
  publicPath,
52
54
  clean: true
@@ -133,7 +135,13 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
133
135
  }
134
136
  }
135
137
  },
136
- sassLoader
138
+ {
139
+ loader: sassLoader,
140
+ options: {
141
+ api: 'modern-compiler',
142
+ implementation: require.resolve('sass-embedded')
143
+ }
144
+ }
137
145
  ]
138
146
  },
139
147
  {
@@ -4,7 +4,9 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
4
4
  output: {
5
5
  path: string;
6
6
  filename: string;
7
+ chunkFilename: string;
7
8
  cssFilename: string;
9
+ cssChunkFilename: string;
8
10
  assetModuleFilename: string;
9
11
  publicPath: string;
10
12
  clean: boolean;
@@ -53,6 +55,16 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
53
55
  test: RegExp;
54
56
  type: string;
55
57
  loader: string;
58
+ options?: undefined;
59
+ generator?: undefined;
60
+ } | {
61
+ test: RegExp;
62
+ type: string;
63
+ loader: string;
64
+ options: {
65
+ api: string;
66
+ implementation: string;
67
+ };
56
68
  generator?: undefined;
57
69
  } | {
58
70
  test: RegExp;
@@ -61,15 +73,18 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
61
73
  filename: string;
62
74
  };
63
75
  loader?: undefined;
76
+ options?: undefined;
64
77
  } | {
65
78
  test: RegExp;
66
79
  type: string;
67
80
  loader?: undefined;
81
+ options?: undefined;
68
82
  generator?: undefined;
69
83
  } | {
70
84
  test: RegExp;
71
85
  loader: string;
72
86
  type?: undefined;
87
+ options?: undefined;
73
88
  generator?: undefined;
74
89
  })[];
75
90
  test?: undefined;
@@ -47,8 +47,10 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
47
47
  entry: entryPath,
48
48
  output: {
49
49
  path: path_1.default.join(projectPath, '/dist'),
50
- filename: 'js/[name].[id].js',
50
+ filename: 'js/[name].[chunkhash].js',
51
+ chunkFilename: 'js/[name].[chunkhash].js',
51
52
  cssFilename: 'css/[name].[contenthash].css',
53
+ cssChunkFilename: 'css/[name].[contenthash].css',
52
54
  assetModuleFilename: 'assets/[name]_[id][ext]',
53
55
  publicPath,
54
56
  clean: true
@@ -102,7 +104,11 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
102
104
  {
103
105
  test: /\.scss$/,
104
106
  type: 'css',
105
- loader: sassLoader
107
+ loader: sassLoader,
108
+ options: {
109
+ api: 'modern-compiler',
110
+ implementation: require.resolve('sass-embedded')
111
+ }
106
112
  },
107
113
  {
108
114
  test: /\.(jpg|png|gif|webp|bmp|jpeg|svg)$/,
@@ -141,14 +141,14 @@ exports.toast = {
141
141
  else {
142
142
  if (Array.isArray(message)) {
143
143
  if (message.length > 0) {
144
- console.log(`${chalk_1.default.red.bold('error')} - ${title || 'There are some errors about Swico'}:`);
144
+ console.log(`${chalk_1.default.red.bold('error')} - ${title || 'Swico errors'}:`);
145
145
  }
146
146
  message.forEach((item) => {
147
147
  console.log(`> ${chalk_1.default.red.bold(item)}`);
148
148
  });
149
149
  }
150
150
  else if (message) {
151
- console.log(`${chalk_1.default.red.bold('error')} - ${title || 'There are some errors about Swico'}:`);
151
+ console.log(`${chalk_1.default.red.bold('error')} - ${title || 'Swico errors'}:`);
152
152
  console.log(`> ${chalk_1.default.red.bold(message)}`);
153
153
  }
154
154
  }
@@ -160,7 +160,7 @@ exports.toast = {
160
160
  console.log(`${chalk_1.default.hex(color).bold('warning')} - ${message}`);
161
161
  }
162
162
  else {
163
- console.log(`${chalk_1.default.hex(color).bold('warning')} - ${title || 'There are some warnings about Swico'}:`);
163
+ console.log(`${chalk_1.default.hex(color).bold('warning')} - ${title || ' Swico warnings'}:`);
164
164
  if (Array.isArray(message)) {
165
165
  message.forEach((item) => {
166
166
  console.log(`> ${chalk_1.default.hex(color).bold(item)}`);