vue.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const {defineConfig} = require('@vue/cli-service')
  2. const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
  3. module.exports = defineConfig({
  4. transpileDependencies: [/node_modules/],
  5. lintOnSave: false,
  6. configureWebpack: {
  7. module: {
  8. // 解决require引入警告
  9. unknownContextCritical: false
  10. },
  11. plugins: [
  12. new NodePolyfillPlugin()
  13. ],
  14. optimization: {
  15. // 抽取公共模块执行压缩
  16. minimize: process.env.NODE_ENV === "production"
  17. },
  18. // sourcemap生成
  19. devtool: process.env.NODE_ENV === "production" ? false : "source-map"
  20. },
  21. devServer: {
  22. port: 8080,
  23. proxy: {
  24. '/proxy_dtbserver/': {
  25. target: 'http://122.228.28.40:10091/dtb',
  26. changeOrigin: true,
  27. pathRewrite: {
  28. '^/proxy_dtbserver': ''
  29. }
  30. },
  31. '/oauth/': {
  32. target: 'http://122.228.28.40:10096/oauth',
  33. changeOrigin: true,
  34. pathRewrite: {
  35. '^/oauth': ''
  36. }
  37. },
  38. }
  39. }
  40. })