vue.config.js 753 B

123456789101112131415161718192021222324252627282930313233
  1. /* eslint-disable no-dupe-keys */
  2. const VUE_IMG_URL = 'https://img-b.caimei365.com/'
  3. module.exports = {
  4. publicPath: process.env.NODE_ENV === 'production' ? './' : './',
  5. outputDir: 'dist',
  6. assetsDir: 'static',
  7. lintOnSave: process.env.NODE_ENV === 'development',
  8. css: {
  9. loaderOptions: {
  10. scss: {
  11. additionalData: '@import "@/globle/variables.scss";'
  12. }
  13. }
  14. },
  15. devServer: {
  16. proxy: {
  17. '/api': {
  18. target: process.env.VUE_APP_URL,
  19. changeOrigin: true,
  20. pathRewrite: {
  21. '^/api': ''
  22. }
  23. },
  24. '/api2': {
  25. target: VUE_IMG_URL,
  26. changeOrigin: true,
  27. pathRewrite: {
  28. '^/api2': ''
  29. }
  30. }
  31. }
  32. }
  33. }