vue.config.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // vue.config.js,一个可选的配置文件
  2. let pagesConfig = require('./page.config.js')
  3. module.exports = {
  4. // publicPath: './',//部署应用包时的基本 URL
  5. baseUrl: './',
  6. outputDir: undefined,//当运行 vue-cli-service build 时生成的生产环境构建文件的目录,Default: 'dist'
  7. assetsDir: undefined,//放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
  8. runtimeCompiler: undefined,//是否使用包含运行时编译器的 Vue 构建版本。Default: false
  9. productionSourceMap: undefined,//如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
  10. parallel: undefined,
  11. pages: pagesConfig //入口文件
  12. //代理
  13. // devServer: {
  14. // // open: process.platform === 'darwin',
  15. // // host: 'localhost',
  16. // // port: 8071,
  17. // // open: true, //配置自动启动浏览器
  18. // proxy: {
  19. // '/env':{
  20. // target:'https://temple.dev.weblf.cn',
  21. // changeOrigin: true,//是否跨域
  22. // secure: true, // 接受 运行在 https 上的服务
  23. // pathRewrite: {
  24. // '^/env': '' //需要rewrite重写
  25. // }
  26. // },
  27. // '/api':{
  28. // target:'https://dev.weblf.cn/api',
  29. // changeOrigin: true,//是否跨域
  30. // secure: true, // 接受 运行在 https 上的服务
  31. // pathRewrite: {
  32. // '^/api': '' //需要rewrite重写
  33. // }
  34. // },
  35. // '/ts/v2':{
  36. // target:'https://temple.dev.weblf.cn/ts/v2',
  37. // changeOrigin: true,//是否跨域
  38. // secure: true, // 接受 运行在 https 上的服务
  39. // pathRewrite: {
  40. // '^/ts/v2': '' //需要rewrite重写
  41. // }
  42. // }
  43. // }
  44. // },
  45. }