vue.config.js初始化配置


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM