swico 2.0.0-beta.31 → 2.0.0-beta.33
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 +3 -4
- package/src/command/build.js +2 -1
- package/src/config/rspack.prod.js +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swico",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.33",
|
|
4
4
|
"description": "Simple, efficient, and practical front-end framework",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"commander": "12.0.0",
|
|
41
41
|
"cross-spawn": "7.0.5",
|
|
42
42
|
"css-loader": "7.1.2",
|
|
43
|
-
"esbuild-loader": "4.3.0",
|
|
44
43
|
"eslint-rspack-plugin": "4.2.1",
|
|
45
44
|
"fs-extra": "11.3.0",
|
|
46
45
|
"html-loader": "5.1.0",
|
|
@@ -55,14 +54,14 @@
|
|
|
55
54
|
"sass-embedded": "1.86.3",
|
|
56
55
|
"sass-loader": "16.0.5",
|
|
57
56
|
"style-loader": "3.3.0",
|
|
57
|
+
"terser-webpack-plugin": "5.3.14",
|
|
58
58
|
"ts-checker-rspack-plugin": "1.1.1",
|
|
59
59
|
"ts-node": "10.9.1",
|
|
60
60
|
"vue-loader": "17.4.2",
|
|
61
61
|
"vue-router": "4.5.0",
|
|
62
62
|
"vue-style-loader": "4.1.3",
|
|
63
63
|
"webpack-bundle-analyzer": "4.9.1",
|
|
64
|
-
"webpack-merge": "6.0.1"
|
|
65
|
-
"webpackbar": "7.0.0"
|
|
64
|
+
"webpack-merge": "6.0.1"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
68
67
|
"@eslint/js": "9.24.0",
|
package/src/command/build.js
CHANGED
|
@@ -34,6 +34,7 @@ function default_1() {
|
|
|
34
34
|
templateType
|
|
35
35
|
});
|
|
36
36
|
const compiler = (0, core_1.rspack)(buildConfig);
|
|
37
|
+
tools_1.toast.info('Building...');
|
|
37
38
|
compiler.run((err, stats) => {
|
|
38
39
|
if (err) {
|
|
39
40
|
tools_1.toast.error(err.stack || err.toString());
|
|
@@ -47,7 +48,7 @@ function default_1() {
|
|
|
47
48
|
if (stats.hasWarnings()) {
|
|
48
49
|
tools_1.toast.warning(info.warnings.map((item) => item.stack || item.message));
|
|
49
50
|
}
|
|
50
|
-
tools_1.toast.success(
|
|
51
|
+
tools_1.toast.success(`Build complete ${(info === null || info === void 0 ? void 0 : info.time) ? `in ${(info.time / 1000).toFixed(2)}s` : ''}`);
|
|
51
52
|
});
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -51,10 +51,8 @@ const path_1 = __importDefault(require("path"));
|
|
|
51
51
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
52
52
|
const config_1 = require("../utils/config");
|
|
53
53
|
const webpack_merge_1 = require("webpack-merge");
|
|
54
|
-
const webpackbar_1 = __importDefault(require("webpackbar"));
|
|
55
|
-
const tools_1 = require("../utils/tools");
|
|
56
54
|
const core_1 = require("@rspack/core");
|
|
57
|
-
const
|
|
55
|
+
const terser_webpack_plugin_1 = __importDefault(require("terser-webpack-plugin"));
|
|
58
56
|
const BundleAnalyzerPlugin = webpack_bundle_analyzer_1.default.BundleAnalyzerPlugin;
|
|
59
57
|
const isAnalyze = process.env.ANALYZE === 'true';
|
|
60
58
|
function default_1(options) {
|
|
@@ -82,8 +80,16 @@ function default_1(options) {
|
|
|
82
80
|
minimize: true,
|
|
83
81
|
minimizer: [
|
|
84
82
|
new core_1.rspack.SwcJsMinimizerRspackPlugin({}),
|
|
85
|
-
new
|
|
86
|
-
|
|
83
|
+
new terser_webpack_plugin_1.default({
|
|
84
|
+
test: /\.js$/,
|
|
85
|
+
parallel: true,
|
|
86
|
+
minify: terser_webpack_plugin_1.default.swcMinify,
|
|
87
|
+
terserOptions: {
|
|
88
|
+
compress: {
|
|
89
|
+
drop_console: !consoleAvailable,
|
|
90
|
+
drop_debugger: true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
87
93
|
})
|
|
88
94
|
],
|
|
89
95
|
splitChunks: {
|
|
@@ -132,11 +138,6 @@ function default_1(options) {
|
|
|
132
138
|
})
|
|
133
139
|
]
|
|
134
140
|
: []),
|
|
135
|
-
new webpackbar_1.default({
|
|
136
|
-
name: 'Swico',
|
|
137
|
-
color: tools_1.colorConfig.theme,
|
|
138
|
-
profile: false
|
|
139
|
-
}),
|
|
140
141
|
...((_g = (_f = customConfig.prod) === null || _f === void 0 ? void 0 : _f.plugins) !== null && _g !== void 0 ? _g : [])
|
|
141
142
|
]
|
|
142
143
|
});
|