long
2023-03-03 36e1de8d3982c0defbd08e6ff52fb4b9597323b4
提交 | 用户 | age
36e1de 1 'use strict'
L 2 // Template version: 1.3.1
3 // see http://vuejs-templates.github.io/webpack for documentation.
4
5 const path = require('path')
6
7 module.exports = {
8   dev: {
9
10     // Paths
11     assetsSubDirectory: 'static',
12     assetsPublicPath: '/',
13     // 反向代理
14     proxyTable: {
15       '/api_local': { // 本地
16         target: 'http://192.168.31.69:8080', // 这个是你服务器开启的接口
17         changeOrigin: true, // 是否跨域
18         pathRewrite: {
19           '^/api_local': ''
20         }
21       },
22       '/api_test': { // 测试环境
23         // target: 'https://test5.phiskin.com/',
24         target: 'http://chatgpt.phiskin.com/', // 这个是你服务器开启的接口
25         changeOrigin: true, // 是否跨域
26         pathRewrite: {
27           '^/api_test': ''
28         }
29       }
30     },
31
32     // Various Dev Server settings
33     host: '0.0.0.0', // can be overwritten by process.env.HOST
34     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
35     autoOpenBrowser: false,
36     errorOverlay: true,
37     notifyOnErrors: true,
38     poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
39
40     /**
41      * Source Maps
42      */
43
44     // https://webpack.js.org/configuration/devtool/#development
45     devtool: 'cheap-module-eval-source-map',
46
47     // If you have problems debugging vue-files in devtools,
48     // set this to false - it *may* help
49     // https://vue-loader.vuejs.org/en/options.html#cachebusting
50     cacheBusting: true,
51
52     cssSourceMap: true
53   },
54
55   build: {
56     // Template for index.html
57     index: path.resolve(__dirname, '../dist/index.html'),
58
59     // Paths
60     assetsRoot: path.resolve(__dirname, '../dist'),
61     assetsSubDirectory: 'static',
62     assetsPublicPath: './',
63     // assetsPublicPath: 'https://miji20.oss-cn-shenzhen.aliyuncs.com/miji/', // oss链接
64     /**
65      * Source Maps
66      */
67
68     productionSourceMap: false, // 打包时不生成map
69     // https://webpack.js.org/configuration/devtool/#production
70     devtool: '#source-map',
71
72     // Gzip off by default as many popular static hosts such as
73     // Surge or Netlify already gzip all static assets for you.
74     // Before setting to `true`, make sure to:
75     // npm install --save-dev compression-webpack-plugin
76     productionGzip: false,
77     productionGzipExtensions: ['js', 'css'],
78
79     // Run the build command with an extra argument to
80     // View the bundle analyzer report after build finishes:
81     // `npm run build --report`
82     // Set to `true` or `false` to always turn it on or off
83     bundleAnalyzerReport: process.env.npm_config_report
84   }
85 }