vue.config.js 862 B

123456789101112131415161718192021222324252627282930
  1. const {
  2. defineConfig
  3. } = require('@vue/cli-service')
  4. module.exports = defineConfig({
  5. transpileDependencies: true
  6. })
  7. module.exports = {
  8. devServer: {
  9. proxy: {
  10. '/api': {
  11. // target: 'http://127.0.0.1:9527', // 设置你的后端 API 地址
  12. target: 'http://127.0.0.1:19527', // 设置你的后端 API 地址
  13. changeOrigin: true, // 允许跨域
  14. // pathRewrite: {
  15. // '^/api': '', // 重写请求路径,去掉 '/api'
  16. // },
  17. },
  18. },
  19. },
  20. chainWebpack: config => {
  21. config.module
  22. .rule('xlsx')
  23. .test(/\.(xlsx)(\?.*)?$/)
  24. .use('file-loader')
  25. .loader('file-loader')
  26. .options({
  27. name: 'files/[name].[hash:8].[ext]'
  28. });
  29. }
  30. };