Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 4a81669

Browse files
authoredOct 27, 2021
Fix 1.6.1 build size issue with removing static asset files (#4506)
* 👷 Update the build configurations * 🔧 Update karma configuraiton to remove uninteded config * 🎨 Update build steps to minimize build size * 🎨 Update build config
1 parent d523d4b commit 4a81669

7 files changed

+243
-713
lines changed
 

‎.tool-versions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 14.17.6

‎dist/web3.min.js

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/web3.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎karma.conf.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ module.exports = function (config) {
3535
colors: true,
3636
logLevel: config.LOG_INFO,
3737
autoWatch: false,
38-
browsers: ['ChromeHeadless', 'FirefoxHeadless'],
39-
browserify: {
40-
ignore: ['**/genesisStates/*.json'],
41-
}
38+
browsers: ['ChromeHeadless', 'FirefoxHeadless']
4239
};
4340

4441
config.set(configuration);

‎package-lock.json

+216-691
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,6 @@
132132
"typescript": "^3.9.7",
133133
"wait-port": "^0.2.9",
134134
"webpack": "^4.44.2",
135-
"webpack-cli": "^3.3.12"
135+
"webpack-cli": "^4.9.1"
136136
}
137137
}

‎webpack.config.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,19 @@ module.exports = {
1212
new webpack.SourceMapDevToolPlugin({
1313
filename: "[file].map",
1414
}),
15+
new webpack.IgnorePlugin({
16+
checkResource(resource) {
17+
// "@ethereumjs/common/genesisStates" consists ~800KB static files which are no more needed
18+
return /(.*\/genesisStates\/.*\.json)/.test(resource)
19+
},
20+
}),
1521
],
1622
resolve: {
17-
modules: ["node_modules"],
23+
alias: {
24+
// To avoid blotting up the `bn.js` library all over the packages
25+
// use single library instance.
26+
"bn.js": path.resolve(__dirname, 'node_modules/bn.js')
27+
}
1828
},
1929
module: {
2030
rules: [
@@ -44,9 +54,6 @@ module.exports = {
4454
},
4555
],
4656
},
47-
externals: [
48-
/.*\/genesisStates\/.*.json/
49-
],
5057
output: {
5158
filename: "[name].min.js",
5259
path: path.resolve(__dirname, "dist"),

0 commit comments

Comments
 (0)
This repository has been archived.