vue.config.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. module.exports = {
  2. publicPath: '/sdMove/', //部署路径后缀
  3. //publicPath: process.env.NODE_ENV === "production" ? "/sdMove" : "/sdMove",
  4. // publicPath: '/', //部署路径后缀
  5. assetsDir: 'static', // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
  6. indexPath: 'index.html', // 指定生成的 index.html 的输出路径 (相对于 outputDir)。也可以是一个绝对路径。
  7. filenameHashing: true, // 文件名hash,默认
  8. lintOnSave: false, // 开发环境下通过 eslint-loader 在每次保存时 lint 代码
  9. productionSourceMap: false, // 关闭生产环境的 source map
  10. devServer: {
  11. overlay: {
  12. // 让浏览器 overlay 同时显示警告和错误
  13. warnings: true,
  14. errors: true
  15. },
  16. host: '0.0.0.0',
  17. port: 8080, // 端口号
  18. // https: false, // https:{type:Boolean}
  19. open: false, // 配置自动启动浏览器
  20. hotOnly: true, // 热更新
  21. proxy: {
  22. // 配置多个跨域
  23. '/': {
  24. //target: 'http://10.108.34.2:80/sdpart/sdp/', //向日葵
  25. target: 'http://172.16.120.104:8089/sdp/', //本地
  26. //target: 'http://101.133.214.75:81/sdpart/sdp/', // 线上 测试
  27. changeOrigin: false,
  28. pathRewrite: {
  29. '': '/'
  30. }
  31. }
  32. },
  33. headers: {
  34. 'Access-Control-Allow-Origin': '*',
  35. }
  36. },
  37. configureWebpack: {
  38. performance: {
  39. hints: 'warning',
  40. // 入口起点的最大体积
  41. maxEntrypointSize: 50000000,
  42. // 生成文件的最大体积
  43. maxAssetSize: 30000000,
  44. // 只给出 js 文件的性能提示
  45. assetFilter: function(assetFilename) {
  46. return assetFilename.endsWith('.js')
  47. }
  48. }
  49. },
  50. };