From 5f44624233198c8afa1a6da35d0333d2a70bdd92 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 17 Jul 2020 11:28:37 +0200 Subject: [PATCH] Strip SUI icons from bundle (unused) (#3218) --- packages/apps/package.json | 1 + packages/apps/public/next/index.html | 14 -------------- packages/apps/webpack.base.config.js | 15 +++++++++++++-- yarn.lock | 13 +++++++++++++ 4 files changed, 27 insertions(+), 16 deletions(-) delete mode 100644 packages/apps/public/next/index.html diff --git a/packages/apps/package.json b/packages/apps/package.json index 79d9463d2b..2469839957 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -31,6 +31,7 @@ "html-webpack-plugin": "^4.3.0", "markdown-loader": "^5.1.0", "mini-css-extract-plugin": "^0.9.0", + "null-loader": "^4.0.0", "style-loader": "^1.2.1", "thread-loader": "^2.1.3", "url-loader": "^4.1.0", diff --git a/packages/apps/public/next/index.html b/packages/apps/public/next/index.html deleted file mode 100644 index ea0a9a3239..0000000000 --- a/packages/apps/public/next/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - https://polkadot.js.org/apps/ - - - The "next" version is now part of the "master" branch. If you are not redirected automatically, follow this https://polkadot.js.org/apps/ link. - - diff --git a/packages/apps/webpack.base.config.js b/packages/apps/webpack.base.config.js index f746609fed..6e8240b007 100644 --- a/packages/apps/webpack.base.config.js +++ b/packages/apps/webpack.base.config.js @@ -86,6 +86,7 @@ function createWebpack (ENV, context) { ] }, { + exclude: [/semantic-ui-css/], test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/], use: [ { @@ -99,6 +100,7 @@ function createWebpack (ENV, context) { ] }, { + exclude: [/semantic-ui-css/], test: [/\.eot$/, /\.ttf$/, /\.svg$/, /\.woff$/, /\.woff2$/], use: [ { @@ -109,6 +111,15 @@ function createWebpack (ENV, context) { } } ] + }, + { + include: [/semantic-ui-css/], + test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.eot$/, /\.ttf$/, /\.svg$/, /\.woff$/, /\.woff2$/], + use: [ + { + loader: require.resolve('null-loader') + } + ] } ] }, @@ -157,13 +168,13 @@ function createWebpack (ENV, context) { chunks: 'initial', enforce: true, name: 'other.01', - test: /node_modules\/(@babel|ansi-styles|asn1|browserify-|chalk|color|color-|crypto-browserify|des\.js|diffie-hellman|elliptic|event-emitter|events|eventemitter3|hash|hmac-drbg|js-sha3|lodash|md5|memoizee|miller-rabin|object-|path-|parse-asn1|pbkdf2|process|public-encrypt|query-string|ripemd160|readable-stream|regenerator-runtime|rtcpeerconnection-shim|stream-browserify|store|timers-browserify|tslib|unified|unist-util|util|vfile|vm-browserify|webrtc-adapter|whatwg-fetch|xxhashjs)/ + test: /node_modules\/(@babel|ansi-styles|asn1|browserify-|buffer|chalk|color|color-|crypto-browserify|des\.js|diffie-hellman|elliptic|event-emitter|events|eventemitter3|hash|hmac-drbg|js-sha3|lodash|memoizee|object-|path-|parse-asn1|pbkdf2|process|public-encrypt|query-string|ripemd160|readable-stream|regenerator-runtime|rtcpeerconnection-shim|safe-buffer|stream-browserify|store|timers-browserify|tslib|unified|unist-util|util|vfile|vm-browserify|webrtc-adapter|whatwg-fetch|xxhashjs)/ }, vendor02: { chunks: 'initial', enforce: true, name: 'other.02', - test: /node_modules\/(attr-accept|base-x|base64-js|blakejs|bip39|bip66|bn\.js|brorand|buffer|camelcase|cipher-base|core-js|core-util|create-|cuint|decode-uri|deep-equal|define-properties|detect-browser|es-abstract|es5-ext|es6-symbol|extend|function-bind|has-symbols|history|html-parse|ieee754|ip-|is-|minimalistic-crypto-utils|moment|next-tick|node-libs-browser|randombytes|randomfill|regexp|rxjs|safe-buffer|scheduler|sdp|secp256k1|setimmediate|sha\.js|through)/ + test: /node_modules\/(attr-accept|base-x|base64-js|blakejs|bip39|bip66|bn\.js|brorand|camelcase|cipher-base|core-js|core-util|create-|cuint|decode-uri|deep-equal|define-properties|detect-browser|es-abstract|es5-ext|es6-symbol|extend|function-bind|has-symbols|history|html-parse|ieee754|ip-|is-|md5|miller-rabin|minimalistic-crypto-utils|moment|next-tick|node-libs-browser|randombytes|randomfill|regexp|rxjs|scheduler|sdp|secp256k1|setimmediate|sha\.js|through)/ } } } diff --git a/yarn.lock b/yarn.lock index ed4ce499f6..821e309f20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3248,6 +3248,7 @@ __metadata: html-webpack-plugin: ^4.3.0 markdown-loader: ^5.1.0 mini-css-extract-plugin: ^0.9.0 + null-loader: ^4.0.0 query-string: ^6.13.1 style-loader: ^1.2.1 thread-loader: ^2.1.3 @@ -17013,6 +17014,18 @@ __metadata: languageName: node linkType: hard +"null-loader@npm:^4.0.0": + version: 4.0.0 + resolution: "null-loader@npm:4.0.0" + dependencies: + loader-utils: ^2.0.0 + schema-utils: ^2.6.5 + peerDependencies: + webpack: ^4.0.0 || ^5.0.0 + checksum: 3/903d4697ae960b067ea0a85597b718202d324338b8dbba1d55b0fe3f115f1dbd32a833aaff8b198552156748bab5e71b1355442969e382b3fbb379e7321e346b + languageName: node + linkType: hard + "num2fraction@npm:^1.2.2": version: 1.2.2 resolution: "num2fraction@npm:1.2.2"