Skip to content
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

refactor: use files in package.json to whitelist files that will be published to NPM #445

Closed
GervinFung opened this issue May 9, 2022 · 0 comments

Comments

@GervinFung
Copy link
Contributor

Hi, may I suggest adding the code snippet below to package.json, instead of using .npmignore for each package

"files": [
    "lib"
],

This works by whitelisting only the transpiled code that will be published to NPM, it will also auto include necessary files such as package.json, README.md, so instead of blacklisting what should not be published, we allowed what should be published and shrink the NPM package size even more. Also, manually adding or removing files from being blacklisted in .npmignore can be tedious, as the project may grow larger because we only need the transpiled code, package.json and nothing else IMO

But that way the test codes will need to have its own folder instead of sharing same folder with source code, or alternatively automate the removal of test files from the transpiled code, I prefer the former approach

If this proposal is accepted, I will make a new PR

@adelsz adelsz mentioned this issue Jan 24, 2023
@adelsz adelsz closed this as completed Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants