vue.config.js publicPath "./" npm run build无效的原因

时间:2019-09-30 16:59:10   收藏:0   阅读:902

 

outputDir
assetsDir
indexPath
必须填
 
module.exports = {
  publicPath: process.env.NODE_ENV === production ? ./ : /,
  outputDir: "dist",
  assetsDir:"static",
  indexPath:index.html,
  devServer: {
    overlay: {
      warnings: false,
      errors: false
    },
    // 设置主机地址
    host: localhost,
    // 设置默认端口
    port: 8080,
    // 设置代理
    proxy: {
      /api: {
        // 目标 API 地址
        target: http://192.168.124.231:8707/, // 接口的域名
        // 如果要代理 websockets
        ws: false,
        // 将主机标头的原点更改为目标URL
        changeOrigin: true
      }
    }
  }
}
 

原文:https://www.cnblogs.com/alone2015/p/11613205.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!