3 ms·
Not everyone uses the .npmignore file. Maybe it's the author's choice, but in the meantime, that's my personal storage space that's being used unnecessarily.
by arthurwhite 3y ago
Not everyone uses the .npmignore file.
Maybe it's the author's choice, but in the meantime, that's my personal storage space that's being used unnecessarily.
I tested it recently on a clean install of Strapi: about 250 MB are freed up. Storage is cheap but that still represents a lot, especially inside a Docker image.
The patterns used to find files are specific enough to target only those files that are well known to be useless at runtime.
- rezonant 3y agoOthers have pointed out that you have no idea which files are useless at runtime when inspecting their filename. Executable JS does not need the .js extension to be loaded by Node.js or any other runtime environment, and on server runtimes files can be read at runtime, so JSON files, markdown files, webassembly modules, or any other kind of non-JS content can have a runtime impact. You are taking a big risk of subtle breakage right now, and a big risk of breakage as you change your project code in the future, as you may start to invoke a code path that needs that resource in the future.