const { defineConfig } = require('@vue/cli-service') const NodePolyfillPlugin = require('node-polyfill-webpack-plugin') // import webpack from 'webpack'; const webpack = require('webpack') const path = require('path') function resolve(dir) { return path.join(__dirname, dir) } module.exports = defineConfig({ transpileDependencies: true, publicPath: '/', configureWebpack: { experiments: { syncWebAssembly: true // !! <- use syncWebAssembly instead of asyncWebAssembly }, plugins: [ new NodePolyfillPlugin(), new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"] }) ] }, // chainWebpack (config) { // config.module // .rule('svg') // .exclude.add(resolve('src/assets/images')) // .end() // config.module // .rule('icons') // .test(/\.svg$/) // .include.add(resolve('src/assets/images')) // .end() // .use('svg-sprite-loader') // .loader('svg-sprite-loader') // .options({ // symbolId: 'icon-[name]' // }) // .end() // }, productionSourceMap: false, // 生产环境的 source map devServer: { port: '2345', client: { overlay: false, }, proxy: { '/api': { target: 'http://120.79.221.36:10090/', changeOrigin: true, }, '/upload': { target: 'http://192.168.0.132:2345', changeOrigin: true, } } } })