| | |
| | | proxy: { |
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | target: `http://192.168.0.170:8002`, |
| | | target: `http://localhost:8001`, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | ["^" + process.env.VUE_APP_BASE_API]: "", |
| | |
| | | }, |
| | | module: { |
| | | rules: [ |
| | | // JS 主体文件处理(含 Babel、Thread 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解压缩静态文件 |