mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
使用 esbuid-loader 提高前端代码的编译速度 (#7525)
* 用esbuild-loader加快打包速度 * fix: dev 模式下,esbuild 不混淆源码 * fix: 变量名混淆、删除不用的包
This commit is contained in:
parent
9574085b03
commit
b649a70e8c
7 changed files with 306 additions and 71 deletions
|
|
@ -5,7 +5,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
|
||||
// const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
const { EsbuildPlugin } = require("esbuild-loader");
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
|
|
@ -23,14 +23,7 @@ module.exports = (env, argv) => {
|
|||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
format: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
extractComments: false,
|
||||
}),
|
||||
new EsbuildPlugin(),
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
|
|
@ -55,7 +48,11 @@ module.exports = (env, argv) => {
|
|||
include: [path.resolve(__dirname, "src")],
|
||||
use: [
|
||||
{
|
||||
loader: "ts-loader",
|
||||
loader: "esbuild-loader",
|
||||
options: {
|
||||
minify: false,
|
||||
keepNames: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "ifdef-loader",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue