vue.config.js

module.exports = {

  publicPath:'./',  //部署应用包时的基本URL

  outputDir:'dist',  //运行build时生成的生产环境构建文件的目录

  assetsDir:'',  //放置静态资源(js,css,img,fonts)的(相对于outputDir)目录

  indexPath:'index.html',  //指定生成的index.html的输出路径

  filenamehash:true,  //文件命名哈希

  pages:undefined,  //在muti-page模式下构建应用

  lintOnSave:'default‘,  //是否在开发环境下通过eslint-loader在每次保存时lint代码

  runtimeCompile:false,  //是否使用包含运行时编译器的vue构建版本

  transileDependencies:[],  //默认情况下babel-loader会忽略所有node_modules中的文件

  productionSourceMap:true,  //生产环境的source map,不需要设为false,加速生产环境构建

  crossorigin:undefined,  //设置生成的HTML中<link ref="stylesheet" >和<script>标签的crossorigin属性

  integrity:false,  //在生成的HTML中的中<link ref="stylesheet" >和<script>标签上启用subresource Integrity

  css:{

    requireModuleExtension:true,

    extract:<bloolean>,  //生产环境true,开发环境false

    sourceMap:false,  //是否为css开启source map

    loaderOptions:{},

  },

  devserve:{

    host:'localhost',

    port:8080,

    proxy:{

      '/api':{

        target:'<url>',  //代理服务器地址

        ws:true,  //是否开启websocket

        changeOrigin:true,  //允许跨域

        pathRewrite:{

          '^api':''

        }

      },

      '/foo':{

        target:'<other-url>'

      }

    }

  }

}

posted @ 2022-02-18 15:12  三又二分之一  阅读(128)  评论(0)    收藏  举报