1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- module.exports = {
- outputDir: "sz-stock",
- publicPath: "/sz-stock",
- // publicPath: '/sunzee-stock',
- assetsDir: "static",
- css: {
- extract: false,
- },
- filenameHashing: true,
- configureWebpack: {
- output: {
- filename: "[name].[hash].js",
- chunkFilename: "[id].[hash].chunk.js",
- },
- },
- devServer: {
- open: true,
- proxy: {
- "/": {
- // 代理地址,这里设置的地址会代替axios中设置的baseURL
- // target: 'http://120.25.151.99:49022', // 测试
- target: 'http://112.74.63.148:49022', // 生产
- // target: "http://120.25.151.99:49011",
- // target: 'http://112.74.63.148:49011',
- // secure: true, // 使用的是http协议设置为 false,https协议设置为 true
- changeOrigin: true, // 是否跨域
- pathRewrite: {
- // '.+?/api': '/api' // 对反向代理的地址进行重写,因为正确的接口路径是没有/api的,所以需要用'^/api': '/',表示请求接口时去掉api
- },
- },
- },
- disableHostCheck: true,
- },
- chainWebpack: (config) => {
- config.plugin('define').tap((definitions) => {
- Object.assign(definitions[0], {
- __VUE_OPTIONS_API__: 'true',
- __VUE_PROD_DEVTOOLS__: 'false',
- __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
- })
- return definitions
- })
- }
- };
|