San3yuan | 4d0e803 | 2025-04-04 17:21:40 +0800 | [diff] [blame] | 1 | const { merge } = require('webpack-merge') |
| 2 | const base = require('./webpack.base.js') |
| 3 | |
| 4 | module.exports = merge(base, { |
| 5 | mode: 'production', // 生产模式 |
San3yuan | 8166d1b | 2025-06-05 23:15:53 +0800 | [diff] [blame] | 6 | plugins: [ |
| 7 | new webpack.DefinePlugin({ |
| 8 | 'process.env': JSON.stringify({ |
| 9 | NODE_ENV: 'production', // 等价于 mode 设置 |
| 10 | PUBLIC_URL: './', // 建议使用相对路径 |
| 11 | API_BASE_URL: 'http://localhost:5008', // 添加API路径 |
| 12 | WEB_BASE_URL: 'http://localhost:8080', // 添加WEB路径 |
| 13 | }) |
| 14 | }), |
| 15 | ], |
San3yuan | 4d0e803 | 2025-04-04 17:21:40 +0800 | [diff] [blame] | 16 | }) |