-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Builds Directories to Make Use of Both lib
and dist
#5739
Conversation
Deploying with Cloudflare Pages
|
packages/web3-core/package.json
Outdated
"clean": "rimraf dist", | ||
"prebuild": "rimraf dist", | ||
"clean": "rimraf dist && rimraf lib", | ||
"prebuild": "yarn clean", | ||
"build": "tsc --build", | ||
"build:check": "node -e \"require('./dist')\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to update build:check
as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit addresses this
"repository": "https://github.com/ChainSafe/web3.js", | ||
"author": "ChainSafe Systems", | ||
"license": "LGPL-3.0", | ||
"files": [ | ||
"dist/**/*" | ||
"lib/**/*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For npm whitelisting only lib
, this will filter out dist
form including in published lib.
This will impact CDN as current CDN is configured to pick minified build through npm ( as per Greg info, I discussed with him last time ).
I personally like it, as it will reduce lib size , so users node_modules will be of less size ( by excluding minified builds) but we will need to configure explicitly CDN for 4.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #5743 to track this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsconfig of some of package is not updated ( web3-erros eth-ens iban http ws rpc-methods )?, all packages should have consistent lib output.
This PR moves the
tsc
compiled files fromdist/
tolib/
for all packages that weren't already doing so. Additionally,web3
andweb3-validator
will compile their web builds todist/
. These changes are to address an issue found when developing the Chainlink plugin that needs to build it's code for the browser. It was discovered that there was a filename conflict between files such as thetsc
compiledweb3_validator.ts
and it's webpack compiled version. By puttingtsc
compiled files inlib/
and webpack compiled files indist/
, we completely avoid this issue for all packages, and users are able to pull in published4.x
Web3.js packages and build using webpack