-
Notifications
You must be signed in to change notification settings - Fork 3
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
Unnecessarily large install size #119
Comments
Actually the intent of Wasn't aware that yarn ignores lockfiles in deps, thanks for letting me know. I'll get working on this... Know of any tools to autogenerate the ESM wrappers for larger projects that export multiple modules? |
Setting it up manually is probably your best bet. Here is an https://github.com/jaydenseric/graphql-react/blob/v11.0.0/package.json#L35 Note that I expose directories instead of individual files (except for index files, which are manually specified for dual ESM/CJS support and automatic resolution), e.g. |
@jaydenseric yeah, but the only way I'm able to get half as much done as I want to is to automate everything as much as possible 😅 I clone all my repos from skeleton projects with canned build config, use |
fix #119 BREAKING CHANGE: drop support for Node < 8
fix #119 BREAKING CHANGE: drop support for Node < 8
🎉 This issue has been resolved in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
It appears that |
Oh hah 🤣 I removed the babel plugin, forgot to remove that |
🎉 This issue has been resolved in version 4.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There are redundant files being published that significantly bloat the install size, which is currently 508 kB:
This is a shame because the actual code is quite elegant at ~5 kB:
https://unpkg.com/browse/[email protected]/index.js
Notably the 356 kB
yarn.lock
file should not be published.It is best practice to whitelist exactly what should be published via a
package.json
files
field, instead of using a blacklist via.npmignore
:https://github.com/jcoreio/promisify-child-process/blob/v3.1.4/.npmignore
Another opportunity to reduce the install size a bit is to remove dev tool config from the
package.json
out into separate config files, which will not be published due to thepackage.json
files
field whitelist.A little more tricky, but it would be nice to get rid of the Babel runtime dependency, as it appears to only be used for the CJS
interopRequireDefault
helper yet it pulls in theregenerator-runtime
dependency:https://unpkg.com/browse/[email protected]/index.js
I suggest refactoring the source to CJS, and using an ESM wrapper with a
package.json
exports
field with conditional exports:https://nodejs.org/api/esm.html#esm_approach_1_use_an_es_module_wrapper
Then you won't need Babel, and Node.js ESM will be supported whilst avoiding the dual package hazard.
The text was updated successfully, but these errors were encountered: