vue.config.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const webpack = require('webpack')
  2. module.exports = {
  3. devServer: {
  4. disableHostCheck: true
  5. },
  6. css: {
  7. loaderOptions: {
  8. less: {
  9. modifyVars: {
  10. 'font-size-base': '12px',
  11. },
  12. javascriptEnabled: true,
  13. },
  14. },
  15. },
  16. configureWebpack: {
  17. plugins: [
  18. new webpack.ProvidePlugin({
  19. 'window.Quill': 'quill/dist/quill.js',
  20. 'Quill': 'quill/dist/quill.js',
  21. }),
  22. ],
  23. },
  24. publicPath: './',
  25. devServer: {
  26. proxy: {
  27. '/api': { //这里最好有一个 /
  28. target: 'http://localhost:8089/123/ub1sjwdz1vo2.html', // 后台接口域名
  29. ws: false, //如果要代理 websockets,配置这个参数
  30. secure: false, // 如果是https接口,需要配置这个参数
  31. changeOrigin: true, //是否跨域
  32. pathRewrite: {
  33. '^/api': ''
  34. }
  35. },
  36. '/api2': { //这里最好有一个 /
  37. target: 'http://localhost:8089/123/g3gbh1bk3.html', // 后台接口域名
  38. ws: false, //如果要代理 websockets,配置这个参数
  39. secure: false, // 如果是https接口,需要配置这个参数
  40. changeOrigin: true, //是否跨域
  41. pathRewrite: {
  42. '^/api2': ''
  43. }
  44. },
  45. }
  46. }
  47. };