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
64 lines
1.6 KiB
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
|
|
},
|
|
externals:{
|
|
'vue':'Vue',
|
|
'element-ui':'ELEMENT'
|
|
},
|
|
optimization:{
|
|
minimize:true
|
|
},
|
|
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,
|
|
}
|
|
}
|
|
}
|
|
})
|