const path = require('path')
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: '/',
outputDir: 'dist',
assetsDir: 'assets',
filenameHashing: true,
lintOnSave: false,
configureWebpack: {
resolve: {
alias: {
'@': resolve('src')
}
}
},
devServer: {
hot: true,
host: 'localhost',
port: 3333,
https: false,
open: true,
before (app) {
app.use((req, res, next) => {
res.set('Access-Control-Allow-Origin', '*')
next()
})
},
proxy: {
'/api': {
target: 'http://www.baidu.com/abc/',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
},
chainWebpack: config => {
}
}