blob: 88ac0ba0b0c395d9ce8b74bfdaf941826b572472 [file] [log] [blame]
San3yuan4d0e8032025-04-04 17:21:40 +08001const { merge } = require('webpack-merge')
2const base = require('./webpack.base.js')
3
4module.exports = merge(base, {
5 mode: 'production', // 生产模式
San3yuan8166d1b2025-06-05 23:15:53 +08006 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 ],
San3yuan4d0e8032025-04-04 17:21:40 +080016})