swico 2.0.0-beta.30 → 2.0.0-beta.32
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 +8 -12
- package/src/config/rspack.prod.js +12 -13
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.32",
|
|
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,20 +34,16 @@ function default_1() {
|
|
|
34
34
|
templateType
|
|
35
35
|
});
|
|
36
36
|
const compiler = (0, core_1.rspack)(buildConfig);
|
|
37
|
-
compiler.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
tools_1.toast.error(info.errors.map((item) => item.stack || item.message));
|
|
37
|
+
compiler.hooks.beforeCompile.tap('beforeCompile', () => {
|
|
38
|
+
tools_1.toast.info('Building...');
|
|
39
|
+
});
|
|
40
|
+
compiler.hooks.done.tap('done', (stats) => {
|
|
41
|
+
const info = stats === null || stats === void 0 ? void 0 : stats.toJson();
|
|
42
|
+
if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) {
|
|
43
|
+
tools_1.toast.error(info === null || info === void 0 ? void 0 : info.errors.map((item) => item.message || item.stack));
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
tools_1.toast.warning(info.warnings.map((item) => item.stack || item.message));
|
|
49
|
-
}
|
|
50
|
-
tools_1.toast.success('Build complete');
|
|
46
|
+
tools_1.toast.info(`Build complete ${(info === null || info === void 0 ? void 0 : info.time) ? `in ${(info.time / 1000).toFixed(2)}s` : ''}`);
|
|
51
47
|
});
|
|
52
48
|
});
|
|
53
49
|
}
|
|
@@ -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) {
|
|
@@ -81,11 +79,17 @@ function default_1(options) {
|
|
|
81
79
|
runtimeChunk: true,
|
|
82
80
|
minimize: true,
|
|
83
81
|
minimizer: [
|
|
84
|
-
new
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
new core_1.rspack.SwcJsMinimizerRspackPlugin({}),
|
|
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
|
+
}
|
|
89
93
|
})
|
|
90
94
|
],
|
|
91
95
|
splitChunks: {
|
|
@@ -134,11 +138,6 @@ function default_1(options) {
|
|
|
134
138
|
})
|
|
135
139
|
]
|
|
136
140
|
: []),
|
|
137
|
-
new webpackbar_1.default({
|
|
138
|
-
name: 'Swico',
|
|
139
|
-
color: tools_1.colorConfig.theme,
|
|
140
|
-
profile: false
|
|
141
|
-
}),
|
|
142
141
|
...((_g = (_f = customConfig.prod) === null || _f === void 0 ? void 0 : _f.plugins) !== null && _g !== void 0 ? _g : [])
|
|
143
142
|
]
|
|
144
143
|
});
|