vue.config.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. const path = require('path')
  2. function resolve(dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. module.exports = {
  6. outputDir: '../../public/weworksingle/',
  7. indexPath: '../../public/weworksingle.html',
  8. productionSourceMap: false, // 关键语句
  9. publicPath: process.env.NODE_ENV === 'production' ? './weworksingle/' : '',
  10. css: {
  11. // 是否使用css分离插件 ExtractTextPlugin
  12. // extract: true,
  13. // 开启 CSS source maps?
  14. sourceMap: false,
  15. // css预设器配置项
  16. loaderOptions: {
  17. postcss: {
  18. plugins: [
  19. require('postcss-px2rem-exclude')({ //配置项,详见官方文档
  20. remUnit: 75, // 换算的基数
  21. exclude: /node_modules/
  22. })
  23. ]
  24. },
  25. less: {
  26. javascriptEnabled: true,
  27. globalVars: {
  28. primary: '#fff'
  29. }
  30. }
  31. },
  32. requireModuleExtension: true
  33. },
  34. devServer: {
  35. proxy: {
  36. "/client": {
  37. // zhuangqixiaoguan.com
  38. // saasdev.zhuangqixiaoguan.com
  39. // wework.weizhihui.ink
  40. target: "https://wework.zqxg.cc/client", //设置你调用的接口域名和端口号 别忘了加http、https
  41. changeOrigin: true, //是否跨域
  42. // secure: true, // 允许https请求
  43. ws: true,
  44. pathRewrite: {
  45. "^/client": "" //这里理解成用‘/api’代替target里面的地址
  46. }
  47. },
  48. "/api": {
  49. target: "https://wework.zqxg.cc/api", //设置你调用的接口域名和端口号 别忘了加http、https
  50. changeOrigin: true, //是否跨域
  51. // secure: true, // 允许https请求
  52. ws: true,
  53. pathRewrite: {
  54. "^/api": "" //这里理解成用‘/api’代替target里面的地址
  55. }
  56. },
  57. "/index": {
  58. target: "https://wework.zqxg.cc/index", //设置你调用的接口域名和端口号 别忘了加http、https
  59. changeOrigin: true, //是否跨域
  60. // secure: true, // 允许https请求
  61. ws: true,
  62. pathRewrite: {
  63. "^/index": "" //这里理解成用‘/api’代替target里面的地址
  64. }
  65. }
  66. }
  67. }
  68. }