mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-15 11:37:57 +01:00
Unify config for webpack
This commit is contained in:
parent
72e433b8f0
commit
e698d84f9c
@ -12,23 +12,45 @@ module.exports = {
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx']
|
||||
},
|
||||
output: {
|
||||
filename: '[name].bundle.js',
|
||||
path: path.resolve(__dirname, 'dist')
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: '/node_modules/'
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)$/,
|
||||
use: [{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
esModule: false,
|
||||
}
|
||||
}]
|
||||
},
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: '/node_modules/'
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)$/,
|
||||
use: [{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
esModule: false,
|
||||
}
|
||||
}]
|
||||
},
|
||||
]
|
||||
},
|
||||
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