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

[feature request] prevent including unnecessary files in the deployed package #47

Open
DerekNonGeneric opened this issue Aug 1, 2022 · 2 comments

Comments

@DerekNonGeneric
Copy link
Member

We should consider adding the "files" stanza to the package.json to create an explicit allowlist and prevent deploying any unnecessary files to the npm registry as part of our package. This would be preferable to using a .npmignore file, which we have been doing so far but is expected to quickly become unmanageable as more files are added.

@hezronkimutai
Copy link

Hi @DerekNonGeneric I would like to handle this nice first good issue.

@DerekNonGeneric
Copy link
Member Author

Hey @hezronkimutai, thanks for stepping up to take this issue! You might be interested in looking at the @ampproject/filesize package for an idea on what we should be doing for this issue. I think we will want to audit the filesize of items specified in package.json as well, which will only be for the things we end up deploying to the registry with our package.

Monitor the size of files in your project specified within package.json.

Check out what the authors of that package are doing themselves for a bit of guidance on this.

  "files": [
    "dist"
  ],

Refs: https://github.com/ampproject/filesize/blob/868a74e43ce058caac0a08595664d4db99e14c48/package.json#L9-L11

Additionally, we should be able to entirely remove the .npmignore file from this repo if this is done correctly. We will want to be sure that the output directory is properly specified in .tsconfig.json file(s) later on so that all the source code we end up shipping gets compiled into the dist directory for this to make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants