How do I get started clearing the node_modules folder when preparing my code for deployment.
I make an application using node -webkit and prefer to include the smallest number of files when merging the final version of the application, since the unpacking process takes some time.
I looked through npm dedupe and used npm install --production to get rid of duplicates and extract only production files, however I still remain with Readme , benchmarks , tests and build files that I don't need.
What I would like to get for each module in the node_modules folder is the node_modules file, if it exists, package.json and all I need to run the module, but nothing more.
Question: How to automatically clear the node_modules directory for committing the SCM header a little in the same direction, but it's about making sure that there is not what I am looking for.
Question: The pure NPMs were again about the same as mine, but not quite there.
This answer helps, as it is a more efficient version for dedupe for combining the final application.
Update
I tried the user module associated with here , but it did not seem to work correctly, even after some involvement.
With all that said, I have not yet found the correct answer.
Here is an example of what I'm looking for.
In my project, I currently have two dependencies: socket.io and socket.io-client .
Together they make up 15 MB with 550 files in 110 folders.
Manual cleaning of Readme , makefile , VC++ assembly files, such as .pdb and .obj and other unnecessary files, I was able to compress it to 2.74 MB using 265 folders 73 .
These are just two modules.
I would like to know if there is a way to do this automatically, preferably with npm .