DSDSWeb/config/index.js

119 lines
3.1 KiB
JavaScript
Raw Normal View History

2024-07-11 18:02:47 +08:00
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
lintOnSave: false,
2024-07-11 18:02:47 +08:00
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
2026-04-07 08:27:40 +08:00
/**
* 使用数组保证匹配顺序必须先于通配 `/api`否则 unit 会落到 gopmas 导致 404
*/
proxyTable: [
{
context: '/api/report/unit/member.htm',
2026-04-03 02:05:29 +08:00
target: 'https://weixin.bdsmart.cn',
changeOrigin: true,
secure: true,
pathRewrite: {
'^/api': '/ds1'
}
},
2026-04-07 08:27:40 +08:00
{
context: '/api/report/unit/total.htm',
target: 'https://weixin.bdsmart.cn',
changeOrigin: true,
secure: true,
pathRewrite: {
'^/api': '/ds1'
}
},
2026-04-07 08:41:39 +08:00
{
context: '/api/report/ship/total.htm',
target: 'https://weixin.bdsmart.cn',
changeOrigin: true,
secure: true,
pathRewrite: {
'^/api': '/ds1'
}
},
2026-04-07 08:27:40 +08:00
{
context: '/api',
2025-10-31 16:15:28 +08:00
target: 'http://test.gopmas.com/ds', // 测试环境
2026-04-07 08:27:40 +08:00
changeOrigin: true,
secure: false,
2024-07-11 18:02:47 +08:00
pathRewrite: {
2026-04-07 08:27:40 +08:00
'^/api': ''
2024-07-11 18:02:47 +08:00
}
},
2026-04-07 08:27:40 +08:00
{
context: '/geoserver',
target: 'http://124.222.8.13:9801', // 测试环境
2026-04-07 08:27:40 +08:00
changeOrigin: true,
secure: false,
2024-07-11 18:02:47 +08:00
pathRewrite: {
2026-04-07 08:27:40 +08:00
'^/geoserver': '/geoserver'
2024-07-11 18:02:47 +08:00
}
}
2026-04-07 08:27:40 +08:00
],
2024-07-11 18:02:47 +08:00
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8181, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
2024-07-11 18:02:47 +08:00
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
/**
* Source Maps
*/
2024-07-15 11:27:56 +08:00
productionSourceMap: false,
2024-07-11 18:02:47 +08:00
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}