const path = require('path')
const webpack = require('webpack')
function resolve(dir) {
return path.join(__dirname, dir)
}
// vue.config.js
module.exports = {
pages: {
index: {
// page 的入口
entry: 'src/main.js',
// 模板来源
template: 'public/index.html',
// 在 dist/index.html 的输出
filename: 'index.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是
<%= htmlWebpackPlugin.options.title %>
title: '河北省住房和城乡建设厅空间信息资源服务平台',
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
chunks: ['chunk-vendors', 'chunk-common', 'index']
}
},
// ...other config
configureWebpack: {
// webpack plugins
plugins: [
// Ignore all locale files of moment.js
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
]
},
productionSourceMap: false, //打包不生成js.map文件
chainWebpack: (config) => {
config.resolve.alias
.set('@$', resolve('src'))
.set('@static', resolve('public/static'))
},
css: {
loaderOptions: {
less: {
modifyVars: {
'primary-color': '#F05A28',
'border-color-base': '#F05A28',
'heading-color': 'rgba(240, 90, 40, 1)',
'link-color': '#F05A28'
},
javascriptEnabled: true
},
}
},
pluginOptions: {
"style-resources-loader": {
preProcessor: "less",
patterns: [
path.resolve(__dirname, 'src/assets/less/variable.less')
]
}
},
devServer: {
port: 1004,
proxy: {
'/proxy_oauth/': {
target: 'http://121.43.55.7:10086',
changeOrigin: true,
pathRewrite: {
'^/proxy_oauth': ''
}
},
'/proxy_data/': {
target: 'http://121.43.55.7:10087',
// target: 'http://192.168.1.61:10087',
changeOrigin: true,
pathRewrite: {
'^/proxy_data': ''
}
},
'/proxy_icon/': {
target: 'http://121.43.55.7:10085',
changeOrigin: true,
pathRewrite: {
'^/proxy_icon': ''
}
},
'/proxy_geoserver/': {
target: 'http://121.43.55.7:8889',
changeOrigin: true,
pathRewrite: {
'^/proxy_geoserver': ''
}
},
}
}
}