vue.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const {defineConfig} = require('@vue/cli-service');
  2. const NodePolyfillPlugin = require("node-polyfill-webpack-plugin") // add
  3. const path = require("path");
  4. const setting = require('./src/util/setting')
  5. let etlUrl='https://91iam-gateway.9n1m.com/bireport'
  6. module.exports = defineConfig({
  7. publicPath: './',
  8. transpileDependencies: true,
  9. productionSourceMap: false,
  10. configureWebpack: {
  11. plugins:[new NodePolyfillPlugin()]
  12. },
  13. chainWebpack: (config) => {
  14. // 内置的svg处理排除指定目录下的文件
  15. config.module.rules.delete('svg')
  16. config.module
  17. .rule("svg-sprite-loader")
  18. .test(/\.svg$/)
  19. .include
  20. .add(path.join(__dirname, "src/components/icon"))
  21. .end()
  22. .use("svg-sprite-loader")
  23. .loader("svg-sprite-loader")
  24. .options({symbolId: "icon-[name]",});
  25. },
  26. devServer: {
  27. host: 'bi.9n1m.com',
  28. port: 80,
  29. client: {overlay: false},
  30. proxy: {
  31. "/etl-api": {
  32. target: etlUrl + "/etl-api",
  33. ws: true,
  34. pathRewrite: {"^/etl-api": "/",},
  35. },
  36. "/api": {
  37. target: setting.host + "/api",
  38. ws: true,
  39. pathRewrite: {"^/api": "/",},
  40. },
  41. "/bi-api": {
  42. target: setting.host + "/bi-api",
  43. ws: true,
  44. pathRewrite: {"^/bi-api": "/",},
  45. }
  46. }
  47. }
  48. });