From 4e2059da34cd1e3cc03019f11d33f73a6f25e977 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期四, 05 六月 2025 12:39:57 +0800 Subject: [PATCH] 修改配置 --- vue.config.js | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/vue.config.js b/vue.config.js index 172f3c9..6a49ef2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -61,16 +61,33 @@ }, module: { rules: [ + // JS 涓讳綋鏂囦欢澶勭悊锛堝惈 Babel銆乀hread Loader锛� + { + test: /\.js$/, + use: [ + { + loader: 'thread-loader', + options: { workers: 4 } + }, + 'babel-loader' + ], + exclude: /\.worker\.js$/, // 馃憟 鎺掗櫎 worker 鏂囦欢 + include: path.resolve(__dirname, 'src') + }, + + // 鍗曠嫭澶勭悊 Worker 鏂囦欢 { test: /\.worker\.js$/, use: { - loader: "worker-loader", + loader: 'worker-loader', options: { - inline: "fallback", - }, + filename: '[name].[contenthash].worker.js', + inline: 'fallback' + } }, - }, - ], + type: 'javascript/auto' // 馃憟 寮哄埗 Webpack 涓嶈鎸夋ā鍧楄В鏋� + } + ] }, plugins: [ // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#浣跨敤gzip瑙e帇缂╅潤鎬佹枃浠� -- Gitblit v1.9.3