|
@@ -1,20 +1,33 @@
|
|
|
+// const webpack = require('webpack')
|
|
|
+// const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
|
|
+// const productionGzipExtensions = ['js', 'css']
|
|
|
+
|
|
|
module.exports = {
|
|
|
configureWebpack: {
|
|
|
externals: {
|
|
|
'AMap': 'AMap' // 高德地图JS API
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 启用gzip
|
|
|
+ // plugins: [
|
|
|
+ // new CompressionWebpackPlugin({
|
|
|
+ // algorithm: 'gzip',
|
|
|
+ // test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
|
|
|
+ // threshold: 10240,
|
|
|
+ // minRatio: 0.8,
|
|
|
+ // deleteOriginalAssets: false // 是否删除源文件
|
|
|
+ // }),
|
|
|
+ // new webpack.optimize.LimitChunkCountPlugin({
|
|
|
+ // maxChunks: 5,
|
|
|
+ // minChunkSize: 100
|
|
|
+ // })
|
|
|
+ // ]
|
|
|
+ // 启用gzip
|
|
|
},
|
|
|
//路径前缀
|
|
|
publicPath: "/",
|
|
|
lintOnSave: true,
|
|
|
productionSourceMap: false,
|
|
|
chainWebpack: (config) => {
|
|
|
- // 开启压缩js代码
|
|
|
- config.optimization.minimize(true)
|
|
|
- // 开启代码分割
|
|
|
- config.optimization.splitChunks({
|
|
|
- chunks: 'all',
|
|
|
- });
|
|
|
//忽略的打包文件
|
|
|
config.externals({
|
|
|
'vue': 'Vue',
|
|
@@ -38,10 +51,11 @@ module.exports = {
|
|
|
'/api': {
|
|
|
//本地服务接口地址
|
|
|
// target: 'http://192.168.3.64:1080',
|
|
|
- target: 'http://192.168.8.105:1080',
|
|
|
+ // target: 'http://192.168.8.105:1080',
|
|
|
// target: 'http://127.0.0.1:1080',
|
|
|
// 打包地址
|
|
|
- // target: 'http://121.37.83.47:10004',//服务器ip
|
|
|
+ target: 'http://121.37.83.47:10004',//服务器ip
|
|
|
+ // target: 'http://192.168.161.11:10004',//服务器ip
|
|
|
// target: 'http://trade.tubaosoft.com:10004',//服务器域名
|
|
|
ws: true,
|
|
|
pathRewrite: {
|