Additional webpack splitting config (#253)
* Additional webpack splitting config * Adjust bundles * Naming of bundles
This commit is contained in:
parent
d4cf3c4d36
commit
40637fe55b
@ -15,6 +15,7 @@
|
||||
"typescript": "^3.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"analyze": "yarn run build && cd packages/apps && yarn run source-map-explorer build/main.*.js",
|
||||
"build": "polkadot-dev-build-ts",
|
||||
"check": "tslint --project . && tsc --noEmit",
|
||||
"clean": "polkadot-dev-clean-build",
|
||||
|
||||
@ -142,11 +142,23 @@ function createWebpack ({ alias = {}, context, name = 'index' }) {
|
||||
runtimeChunk: 'single',
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
vendorOther: {
|
||||
chunks: 'initial',
|
||||
enforce: true,
|
||||
name: 'vendor',
|
||||
test: /node_modules\/(bn\.js|i18next|lodash|react|semantic-ui)/
|
||||
test: /node_modules\/(asn1|bn\.js|buffer|cuint|elliptic|lodash|moment|readable-stream|rxjs)/
|
||||
},
|
||||
vendorReact: {
|
||||
chunks: 'initial',
|
||||
enforce: true,
|
||||
name: 'react',
|
||||
test: /node_modules\/(chart|i18next|react|semantic-ui)/
|
||||
},
|
||||
vendorSodium: {
|
||||
chunks: 'initial',
|
||||
enforce: true,
|
||||
name: 'sodium',
|
||||
test: /node_modules\/(libsodium)/
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -155,6 +167,7 @@ function createWebpack ({ alias = {}, context, name = 'index' }) {
|
||||
hints: false
|
||||
},
|
||||
plugins: plugins.concat([
|
||||
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: JSON.stringify(ENV),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user