Skip to content

Commit 734c833

Browse files
committed
build: 更新 Node.js 版本并优化代码压缩
- 将 Node.js 版本从 18 升级到 23 - 在 webpack 配置中添加 TerserPlugin 以优化代码压缩 - 排除 mathjax 文件,使其不被压缩
1 parent 25794fd commit 734c833

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/jekyll.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup node
3737
uses: actions/setup-node@v3
3838
with:
39-
node-version: '18'
39+
node-version: '23'
4040
- name: Npm build
4141
run: npm install && npm run build-prod
4242
- name: Setup Ruby

webpack.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22
const CopyPlugin = require("copy-webpack-plugin");
3-
3+
const TerserPlugin = require('terser-webpack-plugin');
44
module.exports = {
55
mode: process.env.NODE_ENV,
66
entry: {
@@ -21,4 +21,11 @@ module.exports = {
2121
],
2222
}),
2323
],
24+
optimization: {
25+
minimizer: [
26+
new TerserPlugin({
27+
exclude: /mathjax/, // 排除 mathjax 文件,使其不被压缩
28+
}),
29+
],
30+
},
2431
};

0 commit comments

Comments
 (0)