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


 

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
      }
    }
  }
}
 


免責聲明!

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



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