work_admin/vue.config.js

52 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-01-03 11:23:06 +08:00
const path = require('path');
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BUILD_PATH: '/',
productionSourceMap: false,
css: {
loaderOptions: {
less: {
modifyVars: {
blue: '#3a82f8',
'text-color': '#333'
},
javascriptEnabled: true
}
}
},
devServer: {
2024-01-04 13:53:27 +08:00
// host: process.env.VUE_APP_DEV_HOST || '127.0.0.1',
2024-01-03 11:23:06 +08:00
port: process.env.VUE_APP_DEV_PORT || '8045',
https: false,
hotOnly: false,
proxy: { // 配置跨域
'/api': {
//要访问的跨域的api的域名
2024-01-10 18:00:35 +08:00
// target: `https://work.lihaink.cn`,
target: `${process.env.VUE_APP_API_URL}/`,
2024-01-03 11:23:06 +08:00
ws: true,
changOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
},
configureWebpack: config => {
config.resolve = {
extensions: ['.js', '.vue', '.json', ".css"],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'assets': resolve('src/assets'),
'components': resolve('src/components')
}
}
},
lintOnSave: false
};