vue.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
  2. const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
  3. const WebpackBar = require("webpackbar");
  4. const smp = new SpeedMeasurePlugin();
  5. module.exports = {
  6. productionSourceMap: false,
  7. publicPath: process.env.BASE_URL,
  8. chainWebpack: config => {
  9. config
  10. .plugin("html")
  11. .tap(args => {
  12. // NOTE 确定系统正式名称
  13. args[0].title = "SEEC门户系统";
  14. return args;
  15. });
  16. },
  17. css: {
  18. loaderOptions: {
  19. sass: {
  20. implementation: require("sass"),
  21. },
  22. },
  23. },
  24. configureWebpack: smp.wrap({
  25. devServer: {
  26. proxy: {
  27. "/api": {
  28. // target: "https://p.seec.seecoder.cn/api",
  29. target: "http://localhost:8080/api",
  30. // secure: false,
  31. // changeOrigin: true,
  32. pathRewrite: {
  33. "^/api": ""
  34. }
  35. }
  36. },
  37. port: 8000,
  38. },
  39. plugins: process.env.NODE_ENV === "development" ?
  40. [
  41. new WebpackBar(),
  42. // new BundleAnalyzerPlugin(),
  43. ] : []
  44. }),
  45. };