You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
55 lines
1.3 KiB
const path = require('path');
|
|
|
|
function resolve(dir) {
|
|
return path.join(__dirname, dir)
|
|
}
|
|
|
|
const HOST = '127.0.0.1';
|
|
const PORT = '8045';
|
|
const DEV_URL = 'http://localhost:8888';
|
|
|
|
module.exports = {
|
|
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
|
|
productionSourceMap: false,
|
|
css: {
|
|
loaderOptions: {
|
|
less: {
|
|
modifyVars: {
|
|
blue: '#3a82f8',
|
|
'text-color': '#333'
|
|
},
|
|
javascriptEnabled: true
|
|
}
|
|
}
|
|
},
|
|
devServer: {
|
|
host: HOST,
|
|
port: PORT,
|
|
https: false,
|
|
hotOnly: false,
|
|
proxy: { // 配置跨域
|
|
'/api': {
|
|
//要访问的跨域的api的域名
|
|
target: `${DEV_URL}/`,
|
|
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: undefined
|
|
};
|