vue.config.js 757 B

123456789101112131415161718192021222324252627282930313233
  1. const webpack = require("webpack");
  2. // 配置手册: https://cli.vuejs.org/zh/config/#vue-config-js
  3. const { defineConfig } = require("@vue/cli-service");
  4. const defProxy = {
  5. "/api": {
  6. target: process.env.VUE_APP_MAIN_PROXY,
  7. changeOrigin: true,
  8. },
  9. "/file": {
  10. target: process.env.VUE_APP_MAIN_PROXY_FILE,
  11. changeOrigin: true,
  12. },
  13. };
  14. module.exports = defineConfig({
  15. transpileDependencies: [/\bvue-awesome\b/],
  16. // publicPath: './',
  17. devServer: {
  18. port: 8066,
  19. proxy: defProxy,
  20. },
  21. configureWebpack: {
  22. devtool: "source-map",
  23. plugins: [
  24. // Ignore all locale files of moment.js
  25. new webpack.IgnorePlugin({
  26. resourceRegExp: /^\.\/locale$/,
  27. contextRegExp: /moment$/,
  28. }),
  29. ],
  30. },
  31. });