mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-11 01:43:23 +01:00
Split bundle
This commit is contained in:
parent
7cdde4af4e
commit
3d1a165f0e
@ -1,8 +1,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const CompressionPlugin = require('compression-webpack-plugin');
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
@ -38,14 +36,13 @@ module.exports = {
|
|||||||
splitChunks: {
|
splitChunks: {
|
||||||
cacheGroups: {
|
cacheGroups: {
|
||||||
vendors: {
|
vendors: {
|
||||||
test: /node_modules\/(?!antd\/).*/,
|
test: /node_modules\/(?!@material-ui\/).*/,
|
||||||
name: "vendors",
|
name: "vendors",
|
||||||
chunks: "all",
|
chunks: "all",
|
||||||
},
|
},
|
||||||
// This can be your own design library.
|
material: {
|
||||||
antd: {
|
test: /node_modules\/(@material-ui\/).*/,
|
||||||
test: /node_modules\/(antd\/).*/,
|
name: "material-ui",
|
||||||
name: "antd",
|
|
||||||
chunks: "all",
|
chunks: "all",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -2,6 +2,8 @@ const { merge } = require('webpack-merge');
|
|||||||
const common = require('./webpack.common.js');
|
const common = require('./webpack.common.js');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
const CompressionPlugin = require('compression-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
@ -9,18 +11,6 @@ module.exports = merge(common, {
|
|||||||
minimize: true
|
minimize: true
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new CleanWebpackPlugin(),
|
|
||||||
new CopyWebpackPlugin({
|
|
||||||
patterns: [{
|
|
||||||
from: 'public/*',
|
|
||||||
to: '[name].[ext]',
|
|
||||||
globOptions: {
|
|
||||||
ignore: [
|
|
||||||
'**/index.html'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}),
|
|
||||||
new CompressionPlugin()
|
new CompressionPlugin()
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user