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.

64 lines
1.6 KiB

7 months ago
7 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. externals:{
  17. 'vue':'Vue',
  18. 'element-ui':'ELEMENT'
  19. },
  20. optimization:{
  21. minimize:true
  22. },
  23. plugins: [
  24. new NodePolyfillPlugin(),
  25. new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"] })
  26. ]
  27. },
  28. // chainWebpack (config) {
  29. // config.module
  30. // .rule('svg')
  31. // .exclude.add(resolve('src/assets/images'))
  32. // .end()
  33. // config.module
  34. // .rule('icons')
  35. // .test(/\.svg$/)
  36. // .include.add(resolve('src/assets/images'))
  37. // .end()
  38. // .use('svg-sprite-loader')
  39. // .loader('svg-sprite-loader')
  40. // .options({
  41. // symbolId: 'icon-[name]'
  42. // })
  43. // .end()
  44. // },
  45. productionSourceMap: false, // 生产环境的 source map
  46. devServer: {
  47. port: '2345',
  48. client: {
  49. overlay: false,
  50. },
  51. proxy: {
  52. '/api': {
  53. target: 'http://120.79.221.36:10090/',
  54. changeOrigin: true,
  55. },
  56. '/upload': {
  57. target: 'http://192.168.0.132:2345',
  58. changeOrigin: true,
  59. }
  60. }
  61. }
  62. })