Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install npm packages without the source code

Tags:

npm

Is it possible to install an npm package without all the other artifacts. For instance install only the content of the dist folder for the jQuery npm package?

like image 752
Luis Hernandez Avatar asked Feb 11 '26 06:02

Luis Hernandez


1 Answers

It remains to the module publisher to exclude such files as sources, docs, tests ... and only include build and binary files when they publish their npm package (via prepublish hooks, .npmignore files, etc ...).

Not all maintainers are aware / take that in account ... The only thing you can do, as a module consumer (when you npm install) is to use the --production flag, not to install devDependencies (but that's not what you're looking for)

like image 191
topheman Avatar answered Feb 17 '26 03:02

topheman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!