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: {
          '^/': ''
        }
      }
    }
  }

相关文章:

  • 2021-04-20
  • 2021-12-08
  • 2022-01-15
  • 2021-07-09
  • 2021-11-19
  • 2022-03-15
  • 2021-09-28
  • 2021-07-24
猜你喜欢
  • 2021-06-22
  • 2021-07-21
  • 2021-12-05
  • 2021-11-30
  • 2021-11-03
  • 2021-10-26
  • 2021-05-28
相关资源
相似解决方案