-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Update Builds Directories to Make Use of Both lib and dist
#5739
Conversation
Deploying with
|
| Latest commit: |
266b612
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://232e7388.web3-js-docs.pages.dev |
| Branch Preview URL: | https://wyatt-4-x-fix-build.web3-js-docs.pages.dev |
packages/web3-core/package.json
Outdated
| "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
| "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
jdevcs
left a comment
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
tsccompiled files fromdist/tolib/for all packages that weren't already doing so. Additionally,web3andweb3-validatorwill 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 thetsccompiledweb3_validator.tsand it's webpack compiled version. By puttingtsccompiled files inlib/and webpack compiled files indist/, we completely avoid this issue for all packages, and users are able to pull in published4.xWeb3.js packages and build using webpack