Extensive_Web/vue.config.js

76 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

const { resolve } = require('path')
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
publicPath: '/',
lintOnSave: false,
// 打包时不生成.map文件
productionSourceMap: false,
chainWebpack: (config) => {
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
config.plugin('html')
.tap(args => {
args[0].title = "Extensive Imaging";
return args;
})
},
configureWebpack: {
devtool: 'source-map',
output: {
filename: `static/js/[name].[contenthash:8].js`,
chunkFilename: `static/js/[name].[chunkhash:8].js`,
assetModuleFilename: 'static/wasm/[name].[contenthash:8][ext]'
},
resolve: {
extensions: ['.js', '.vue', '.json'], // 当引入文件时默认先找.js后缀的文件没找到再从左往右继续
alias: {
vue$: 'vue/dist/vue.esm.js',
'@': resolve('src')
}
},
plugins: [
],
performance: {
hints: false
},
module: {
rules: [
]
}
},
devServer: {
// https: true,
host: '0.0.0.0',
port: 9528,
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: 'http://123.56.94.154:9530',
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '/api/v1'
}
},
'/img_url': {
target: 'http://123.56.94.154:9530',
changeOrigin: true,
pathRewrite: {
'^/img_url': ''
}
}
}
}
})