You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

5 months ago
  1. const { defineConfig } = require('@vue/cli-service')
  2. const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
  3. // import webpack from 'webpack';
  4. const webpack = require('webpack')
  5. const path = require('path')
  6. function resolve(dir) {
  7. return path.join(__dirname, dir)
  8. }
  9. module.exports = defineConfig({
  10. transpileDependencies: true,
  11. publicPath: '/',
  12. configureWebpack: {
  13. experiments: {
  14. syncWebAssembly: true // !! <- use syncWebAssembly instead of asyncWebAssembly
  15. },
  16. plugins: [
  17. new NodePolyfillPlugin(),
  18. new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"] })
  19. ]
  20. },
  21. // chainWebpack (config) {
  22. // config.module
  23. // .rule('svg')
  24. // .exclude.add(resolve('src/assets/images'))
  25. // .end()
  26. // config.module
  27. // .rule('icons')
  28. // .test(/\.svg$/)
  29. // .include.add(resolve('src/assets/images'))
  30. // .end()
  31. // .use('svg-sprite-loader')
  32. // .loader('svg-sprite-loader')
  33. // .options({
  34. // symbolId: 'icon-[name]'
  35. // })
  36. // .end()
  37. // },
  38. productionSourceMap: false, // 生产环境的 source map
  39. devServer: {
  40. port: '2345',
  41. client: {
  42. overlay: false,
  43. },
  44. proxy: {
  45. '/api': {
  46. target: 'http://120.79.221.36:10090/',
  47. changeOrigin: true,
  48. },
  49. '/upload': {
  50. target: 'http://192.168.0.132:2345',
  51. changeOrigin: true,
  52. }
  53. }
  54. }
  55. })