vue.config.js 731 B

12345678910111213141516171819202122232425262728293031
  1. const { defineConfig } = require("@vue/cli-service");
  2. const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
  3. module.exports = defineConfig({
  4. publicPath: "/",
  5. transpileDependencies: true,
  6. configureWebpack: {
  7. plugins: [new NodePolyfillPlugin()],
  8. optimization: {
  9. splitChunks: {
  10. chunks: "all",
  11. },
  12. },
  13. devtool: 'source-map'
  14. },
  15. devServer: {
  16. open: false,
  17. host: '0.0.0.0',
  18. port: 8888,
  19. proxy: {
  20. [process.env.VUE_APP_BASE_NAME]: {
  21. ws: false,
  22. target: process.env.VUE_APP_BASE_URL,//代理地址
  23. changeOrigin: true, // 是否跨域
  24. pathRewrite: {
  25. ['^'+process.env.VUE_APP_BASE_NAME]: ''
  26. }
  27. },
  28. }
  29. }
  30. });