let path = require('path')
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
baseUrl: './',
outputDir: 'dist',
lintOnSave: true,
runtimeCompiler: true, //關鍵點在這
// 調整內部的 webpack 配置。
// 查閱 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/webpack.md
chainWebpack: config => {
config.resolve.alias.set('@', resolve('src'))
},
configureWebpack: () => {},
// 配置 webpack-dev-server 行為。
devServer: {
host: '0.0.0.0',
port: 8080,
proxy: {
'/': {
// target: 'http://www.xxxxxx.com/',
target: 'http://192.168.0.0:8000/', //自己的ip地址
changeOrigin: true,
ws: false,
pathRewrite: {
'^/': ''
}
}
}
}
}