swico 2.0.0-beta.3 → 2.0.0-beta.5

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.3",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -41,9 +41,6 @@
41
41
  "commander": "12.0.0",
42
42
  "cross-spawn": "7.0.5",
43
43
  "css-loader": "6.3.0",
44
- "eslint-plugin-react": "7.33.2",
45
- "eslint-plugin-react-hooks": "4.3.0",
46
- "eslint-plugin-vue": "9.19.2",
47
44
  "eslint-webpack-plugin": "4.0.0",
48
45
  "fs-extra": "11.3.0",
49
46
  "html-loader": "5.0.0",
@@ -13,6 +13,11 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
13
13
  };
14
14
  target: string[];
15
15
  module: {
16
+ parser: {
17
+ 'css/auto': {
18
+ namedExports: boolean;
19
+ };
20
+ };
16
21
  rules: ({
17
22
  test: RegExp;
18
23
  exclude: RegExp;
@@ -55,6 +55,11 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
55
55
  },
56
56
  target: ['web', 'es5'],
57
57
  module: {
58
+ parser: {
59
+ 'css/auto': {
60
+ namedExports: false
61
+ }
62
+ },
58
63
  rules: [
59
64
  {
60
65
  test: /\.(tsx|ts|jsx)$/,
@@ -89,7 +94,6 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
89
94
  test: /\.css$/,
90
95
  type: 'css/auto',
91
96
  use: [
92
- core_1.rspack.CssExtractRspackPlugin.loader,
93
97
  cssLoader,
94
98
  {
95
99
  loader: postcssLoader,
@@ -105,8 +109,6 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
105
109
  test: /\.less$/,
106
110
  type: 'css/auto',
107
111
  use: [
108
- core_1.rspack.CssExtractRspackPlugin.loader,
109
- cssLoader,
110
112
  {
111
113
  loader: postcssLoader,
112
114
  options: {
@@ -122,8 +124,6 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
122
124
  test: /\.scss$/,
123
125
  type: 'css/auto',
124
126
  use: [
125
- core_1.rspack.CssExtractRspackPlugin.loader,
126
- cssLoader,
127
127
  {
128
128
  loader: postcssLoader,
129
129
  options: {
@@ -10,6 +10,11 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
10
10
  };
11
11
  target: string[];
12
12
  module: {
13
+ parser: {
14
+ 'css/auto': {
15
+ namedExports: boolean;
16
+ };
17
+ };
13
18
  rules: ({
14
19
  test: RegExp;
15
20
  loader: string;
@@ -42,57 +47,24 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
42
47
  } | {
43
48
  oneOf: ({
44
49
  test: RegExp;
45
- oneOf: ({
46
- resourceQuery: RegExp;
47
- use: (string | {
48
- loader: string;
49
- options: {
50
- modules: {
51
- localIdentName: string;
52
- };
53
- postcssOptions?: undefined;
54
- };
55
- } | {
56
- loader: string;
57
- options: {
58
- postcssOptions: {
59
- plugins: string[][];
60
- };
61
- modules?: undefined;
62
- };
63
- })[];
64
- } | {
65
- use: (string | {
66
- loader: string;
67
- options: {
68
- postcssOptions: {
69
- plugins: string[][];
70
- };
71
- };
72
- })[];
73
- resourceQuery?: undefined;
74
- })[];
75
- type?: undefined;
50
+ type: string;
51
+ loader: string;
76
52
  generator?: undefined;
77
- loader?: undefined;
78
53
  } | {
79
54
  test: RegExp;
80
55
  type: string;
81
56
  generator: {
82
57
  filename: string;
83
58
  };
84
- oneOf?: undefined;
85
59
  loader?: undefined;
86
60
  } | {
87
61
  test: RegExp;
88
62
  type: string;
89
- oneOf?: undefined;
90
- generator?: undefined;
91
63
  loader?: undefined;
64
+ generator?: undefined;
92
65
  } | {
93
66
  test: RegExp;
94
67
  loader: string;
95
- oneOf?: undefined;
96
68
  type?: undefined;
97
69
  generator?: undefined;
98
70
  })[];
@@ -54,6 +54,11 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
54
54
  },
55
55
  target: ['web', 'es5'],
56
56
  module: {
57
+ parser: {
58
+ 'css/auto': {
59
+ namedExports: false
60
+ }
61
+ },
57
62
  rules: [
58
63
  {
59
64
  test: /\.vue$/,
@@ -85,138 +90,15 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
85
90
  },
86
91
  {
87
92
  oneOf: [
88
- {
89
- test: /\.css$/,
90
- oneOf: [
91
- {
92
- resourceQuery: /module/,
93
- use: [
94
- vueStyleLoader,
95
- {
96
- loader: cssLoader,
97
- options: {
98
- modules: {
99
- localIdentName: 'moduleStyle_[local]_[contenthash:8]'
100
- }
101
- }
102
- },
103
- {
104
- loader: postcssLoader,
105
- options: {
106
- postcssOptions: {
107
- plugins: [['autoprefixer']]
108
- }
109
- }
110
- }
111
- ]
112
- },
113
- {
114
- use: [
115
- env === 'dev'
116
- ? vueStyleLoader
117
- : core_1.CssExtractRspackPlugin.loader,
118
- cssLoader,
119
- {
120
- loader: postcssLoader,
121
- options: {
122
- postcssOptions: {
123
- plugins: [['autoprefixer']]
124
- }
125
- }
126
- }
127
- ]
128
- }
129
- ]
130
- },
131
93
  {
132
94
  test: /\.less$/,
133
- oneOf: [
134
- {
135
- resourceQuery: /module/,
136
- use: [
137
- vueStyleLoader,
138
- {
139
- loader: cssLoader,
140
- options: {
141
- modules: {
142
- localIdentName: 'moduleStyle_[local]_[contenthash:8]'
143
- }
144
- }
145
- },
146
- {
147
- loader: postcssLoader,
148
- options: {
149
- postcssOptions: {
150
- plugins: [['autoprefixer']]
151
- }
152
- }
153
- },
154
- lessLoader
155
- ]
156
- },
157
- {
158
- use: [
159
- env === 'dev'
160
- ? vueStyleLoader
161
- : core_1.CssExtractRspackPlugin.loader,
162
- cssLoader,
163
- {
164
- loader: postcssLoader,
165
- options: {
166
- postcssOptions: {
167
- plugins: [['autoprefixer']]
168
- }
169
- }
170
- },
171
- lessLoader
172
- ]
173
- }
174
- ]
95
+ type: 'css',
96
+ loader: lessLoader
175
97
  },
176
98
  {
177
99
  test: /\.scss$/,
178
- oneOf: [
179
- {
180
- resourceQuery: /module/,
181
- use: [
182
- vueStyleLoader,
183
- {
184
- loader: cssLoader,
185
- options: {
186
- modules: {
187
- localIdentName: 'moduleStyle_[local]_[contenthash:8]'
188
- }
189
- }
190
- },
191
- {
192
- loader: postcssLoader,
193
- options: {
194
- postcssOptions: {
195
- plugins: [['autoprefixer']]
196
- }
197
- }
198
- },
199
- sassLoader
200
- ]
201
- },
202
- {
203
- use: [
204
- env === 'dev'
205
- ? vueStyleLoader
206
- : core_1.CssExtractRspackPlugin.loader,
207
- cssLoader,
208
- {
209
- loader: postcssLoader,
210
- options: {
211
- postcssOptions: {
212
- plugins: [['autoprefixer']]
213
- }
214
- }
215
- },
216
- sassLoader
217
- ]
218
- }
219
- ]
100
+ type: 'css',
101
+ loader: sassLoader
220
102
  },
221
103
  {
222
104
  test: /\.(jpg|png|gif|webp|bmp|jpeg|svg)$/,
@@ -46,15 +46,14 @@ const core_1 = require("@rspack/core");
46
46
  const BundleAnalyzerPlugin = webpack_bundle_analyzer_1.default.BundleAnalyzerPlugin;
47
47
  const isAnalyze = process.env.ANALYZE === 'true';
48
48
  function default_1(options) {
49
- var _a, _b, _c, _d, _e, _f, _g;
49
+ var _a, _b, _c, _d, _e;
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
51
  const { projectPath, customConfig, templateType } = options;
52
- const getBaseConfig = (yield Promise.resolve(`${templateType === 'vue' ? './webpack.base.vue' : './webpack.base.react'}`).then(s => __importStar(require(s)))).default;
52
+ const getBaseConfig = (yield Promise.resolve(`${templateType === 'vue' ? './rspack.base.vue' : './rspack.base.react'}`).then(s => __importStar(require(s)))).default;
53
53
  const baseConfig = yield getBaseConfig(Object.assign(Object.assign({}, options), { env: 'prod' }));
54
- const consoleAvailable = (_b = (_a = customConfig.prod) === null || _a === void 0 ? void 0 : _a.console) !== null && _b !== void 0 ? _b : config_1.initConfig.console;
55
54
  const isPublicDirExist = yield fs_extra_1.default.exists(path_1.default.join(projectPath, '/public'));
56
- const copyConfig = (_d = (_c = customConfig.prod) === null || _c === void 0 ? void 0 : _c.copy) !== null && _d !== void 0 ? _d : config_1.initConfig.copy;
57
- const customDevtool = (_e = customConfig.prod.devtool) !== null && _e !== void 0 ? _e : customConfig.base.devtool;
55
+ const copyConfig = (_b = (_a = customConfig.prod) === null || _a === void 0 ? void 0 : _a.copy) !== null && _b !== void 0 ? _b : config_1.initConfig.copy;
56
+ const customDevtool = (_c = customConfig.prod.devtool) !== null && _c !== void 0 ? _c : customConfig.base.devtool;
58
57
  return (0, webpack_merge_1.merge)(baseConfig, {
59
58
  performance: {
60
59
  hints: false
@@ -115,7 +114,7 @@ function default_1(options) {
115
114
  color: tools_1.colorConfig.theme,
116
115
  profile: false
117
116
  }),
118
- ...((_g = (_f = customConfig.prod) === null || _f === void 0 ? void 0 : _f.plugins) !== null && _g !== void 0 ? _g : [])
117
+ ...((_e = (_d = customConfig.prod) === null || _d === void 0 ? void 0 : _d.plugins) !== null && _e !== void 0 ? _e : [])
119
118
  ]
120
119
  });
121
120
  });