Split robohash statics (#3929)

This commit is contained in:
Jaco Greeff 2020-10-24 11:57:44 +02:00 committed by GitHub
parent 5e1d49e78c
commit ea173c053d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View File

@ -2,10 +2,20 @@
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import networks from '@polkadot/networks';
import { assert } from '@polkadot/util';
export const KUSAMA_GENESIS = '0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe';
function getGenesis (name: string): string {
const network = networks.find(({ network }) => network === name);
export const POLKADOT_GENESIS = '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3';
assert(network && network.genesisHash[0], `Unable to find genesisHash for ${name}`);
return network.genesisHash[0];
}
export const KUSAMA_GENESIS = getGenesis('kusama');
export const POLKADOT_GENESIS = getGenesis('polkadot');
export const POLKADOT_DENOM_BLOCK = new BN(1248328);
export const KULUPU_GENESIS = '0xf7a99d3cb92853d00d5275c971c132c074636256583fee53b3bbe60d7b8769ba';
export const KULUPU_GENESIS = getGenesis('kulupu');

View File

@ -145,10 +145,15 @@ function createWebpack (ENV, context) {
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
...mapChunks('robohash', [
/* 00 */ /RoboHash\/(backgrounds|sets\/set1)/,
/* 01 */ /RoboHash\/sets\/set(2|3)/,
/* 02 */ /RoboHash\/sets\/set(4|5)/
]),
...mapChunks('polkadot', [
/* 00 */ /node_modules\/@polkadot\/(wasm)/,
/* 01 */ /node_modules\/(@polkadot\/(api|metadata|rpc|types))/,
/* 02 */ /node_modules\/(@polkadot\/(extension|keyring|react|ui|util|vanitygen)|@acala-network|@edgeware|@laminar|@ledgerhq|@open-web3|@subsocial|@zondax|edgeware)/
/* 02 */ /node_modules\/(@polkadot\/(extension|keyring|networks|react|ui|util|vanitygen)|@acala-network|@edgeware|@laminar|@ledgerhq|@open-web3|@subsocial|@zondax|edgeware)/
]),
...mapChunks('react', [
/* 00 */ /node_modules\/(@fortawesome)/,