swico 2.0.0-beta.4 → 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.4",
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",
@@ -94,7 +94,6 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
94
94
  test: /\.css$/,
95
95
  type: 'css/auto',
96
96
  use: [
97
- core_1.rspack.CssExtractRspackPlugin.loader,
98
97
  cssLoader,
99
98
  {
100
99
  loader: postcssLoader,
@@ -110,8 +109,6 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
110
109
  test: /\.less$/,
111
110
  type: 'css/auto',
112
111
  use: [
113
- core_1.rspack.CssExtractRspackPlugin.loader,
114
- cssLoader,
115
112
  {
116
113
  loader: postcssLoader,
117
114
  options: {
@@ -127,8 +124,6 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
127
124
  test: /\.scss$/,
128
125
  type: 'css/auto',
129
126
  use: [
130
- core_1.rspack.CssExtractRspackPlugin.loader,
131
- cssLoader,
132
127
  {
133
128
  loader: postcssLoader,
134
129
  options: {
@@ -47,57 +47,24 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
47
47
  } | {
48
48
  oneOf: ({
49
49
  test: RegExp;
50
- oneOf: ({
51
- resourceQuery: RegExp;
52
- use: (string | {
53
- loader: string;
54
- options: {
55
- modules: {
56
- localIdentName: string;
57
- };
58
- postcssOptions?: undefined;
59
- };
60
- } | {
61
- loader: string;
62
- options: {
63
- postcssOptions: {
64
- plugins: string[][];
65
- };
66
- modules?: undefined;
67
- };
68
- })[];
69
- } | {
70
- use: (string | {
71
- loader: string;
72
- options: {
73
- postcssOptions: {
74
- plugins: string[][];
75
- };
76
- };
77
- })[];
78
- resourceQuery?: undefined;
79
- })[];
80
- type?: undefined;
50
+ type: string;
51
+ loader: string;
81
52
  generator?: undefined;
82
- loader?: undefined;
83
53
  } | {
84
54
  test: RegExp;
85
55
  type: string;
86
56
  generator: {
87
57
  filename: string;
88
58
  };
89
- oneOf?: undefined;
90
59
  loader?: undefined;
91
60
  } | {
92
61
  test: RegExp;
93
62
  type: string;
94
- oneOf?: undefined;
95
- generator?: undefined;
96
63
  loader?: undefined;
64
+ generator?: undefined;
97
65
  } | {
98
66
  test: RegExp;
99
67
  loader: string;
100
- oneOf?: undefined;
101
68
  type?: undefined;
102
69
  generator?: undefined;
103
70
  })[];
@@ -90,138 +90,15 @@ function default_1({ projectPath, entryPath, env, customConfig }) {
90
90
  },
91
91
  {
92
92
  oneOf: [
93
- {
94
- test: /\.css$/,
95
- oneOf: [
96
- {
97
- resourceQuery: /module/,
98
- use: [
99
- vueStyleLoader,
100
- {
101
- loader: cssLoader,
102
- options: {
103
- modules: {
104
- localIdentName: 'moduleStyle_[local]_[contenthash:8]'
105
- }
106
- }
107
- },
108
- {
109
- loader: postcssLoader,
110
- options: {
111
- postcssOptions: {
112
- plugins: [['autoprefixer']]
113
- }
114
- }
115
- }
116
- ]
117
- },
118
- {
119
- use: [
120
- env === 'dev'
121
- ? vueStyleLoader
122
- : core_1.CssExtractRspackPlugin.loader,
123
- cssLoader,
124
- {
125
- loader: postcssLoader,
126
- options: {
127
- postcssOptions: {
128
- plugins: [['autoprefixer']]
129
- }
130
- }
131
- }
132
- ]
133
- }
134
- ]
135
- },
136
93
  {
137
94
  test: /\.less$/,
138
- oneOf: [
139
- {
140
- resourceQuery: /module/,
141
- use: [
142
- vueStyleLoader,
143
- {
144
- loader: cssLoader,
145
- options: {
146
- modules: {
147
- localIdentName: 'moduleStyle_[local]_[contenthash:8]'
148
- }
149
- }
150
- },
151
- {
152
- loader: postcssLoader,
153
- options: {
154
- postcssOptions: {
155
- plugins: [['autoprefixer']]
156
- }
157
- }
158
- },
159
- lessLoader
160
- ]
161
- },
162
- {
163
- use: [
164
- env === 'dev'
165
- ? vueStyleLoader
166
- : core_1.CssExtractRspackPlugin.loader,
167
- cssLoader,
168
- {
169
- loader: postcssLoader,
170
- options: {
171
- postcssOptions: {
172
- plugins: [['autoprefixer']]
173
- }
174
- }
175
- },
176
- lessLoader
177
- ]
178
- }
179
- ]
95
+ type: 'css',
96
+ loader: lessLoader
180
97
  },
181
98
  {
182
99
  test: /\.scss$/,
183
- oneOf: [
184
- {
185
- resourceQuery: /module/,
186
- use: [
187
- vueStyleLoader,
188
- {
189
- loader: cssLoader,
190
- options: {
191
- modules: {
192
- localIdentName: 'moduleStyle_[local]_[contenthash:8]'
193
- }
194
- }
195
- },
196
- {
197
- loader: postcssLoader,
198
- options: {
199
- postcssOptions: {
200
- plugins: [['autoprefixer']]
201
- }
202
- }
203
- },
204
- sassLoader
205
- ]
206
- },
207
- {
208
- use: [
209
- env === 'dev'
210
- ? vueStyleLoader
211
- : core_1.CssExtractRspackPlugin.loader,
212
- cssLoader,
213
- {
214
- loader: postcssLoader,
215
- options: {
216
- postcssOptions: {
217
- plugins: [['autoprefixer']]
218
- }
219
- }
220
- },
221
- sassLoader
222
- ]
223
- }
224
- ]
100
+ type: 'css',
101
+ loader: sassLoader
225
102
  },
226
103
  {
227
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
  });