mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 06:37:56 +01:00
Unify config for webpack
This commit is contained in:
parent
493ad7fd98
commit
c8a1352376
@ -12,6 +12,10 @@ module.exports = {
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx']
|
||||
},
|
||||
output: {
|
||||
filename: '[name].bundle.js',
|
||||
path: path.resolve(__dirname, 'dist')
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.tsx?$/,
|
||||
@ -29,6 +33,24 @@ module.exports = {
|
||||
},
|
||||
]
|
||||
},
|
||||
optimization: {
|
||||
usedExports: true,
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendors: {
|
||||
test: /node_modules\/(?!antd\/).*/,
|
||||
name: "vendors",
|
||||
chunks: "all",
|
||||
},
|
||||
// This can be your own design library.
|
||||
antd: {
|
||||
test: /node_modules\/(antd\/).*/,
|
||||
name: "antd",
|
||||
chunks: "all",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(),
|
||||
new CopyWebpackPlugin({
|
||||
|
@ -17,10 +17,6 @@ module.exports = merge(common, {
|
||||
]
|
||||
}
|
||||
},
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'dist')
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: path.join(__dirname, 'public/index.html'),
|
||||
|
@ -5,27 +5,6 @@ const path = require('path');
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
filename: '[name].bundle.js',
|
||||
path: path.resolve(__dirname, 'dist')
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
usedExports: true,
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendors: {
|
||||
test: /node_modules\/(?!antd\/).*/,
|
||||
name: "vendors",
|
||||
chunks: "all",
|
||||
},
|
||||
// This can be your own design library.
|
||||
antd: {
|
||||
test: /node_modules\/(antd\/).*/,
|
||||
name: "antd",
|
||||
chunks: "all",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
minimize: true }
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user