vue.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const { defineConfig } = require('@vue/cli-service')
  2. const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
  3. module.exports = defineConfig({
  4. configureWebpack: {
  5. plugins: [new NodePolyfillPlugin()]
  6. },
  7. transpileDependencies: true,
  8. lintOnSave: false,
  9. devServer: {
  10. historyApiFallback: true,
  11. allowedHosts: 'all',
  12. proxy: {
  13. '/api': {
  14. target: 'http://www.gmcyy.com/api/',
  15. changeOrigin: true,
  16. pathRewrite: {
  17. '^/api': ''
  18. }
  19. },
  20. '/adminApi': {
  21. target: 'http://www.gmcyy.com/api/',
  22. changeOrigin: true,
  23. pathRewrite: {
  24. '^/adminApi': ''
  25. }
  26. }
  27. }
  28. },
  29. css: {
  30. loaderOptions: {
  31. sass: {
  32. sassOptions: {
  33. outputStyle: 'expanded'
  34. },
  35. prependData: '@import "~@/variables.sass"'
  36. },
  37. scss: {},
  38. postcss: {
  39. postcssOptions: {
  40. plugins: [
  41. require('postcss-plugin-px2rem')({
  42. rootValue: 144,
  43. minPixelValue: 5,
  44. selectorBlackList: ['mobile-h-s']
  45. })
  46. ]
  47. }
  48. }
  49. }
  50. }
  51. })