2

Are there ways to make node_modules more compact for client side usage? For example with nodewebkit?

I think about removing unecessary files and minification.

Thanks!

robert
  • 797
  • 3
  • 9
  • 23
  • Possible duplicate of [How to clean node\_modules folder when prepping for deployment](http://stackoverflow.com/questions/20723657/how-to-clean-node-modules-folder-when-prepping-for-deployment) – dcohenb Mar 29 '16 at 13:29

2 Answers2

0

I think you can use npm install --production, so you don't install unnecessary modules for your production environment like eg: grunt, gulp, mocha, etc. Of course it depends if you install the development modules with npm install --save-dev

fuelusumar
  • 797
  • 8
  • 15
  • Thanks...I already go this way! I just wanna automatically remove unnecessary file out of my module folders and maybe zip them or something else – robert Mar 07 '16 at 07:04
0

Yes, there are ways.

Do the following in this order:

  • npm install --production
  • npm dedupe to flatten the hirarchy and remove duplicates
  • use grunt package minifier if you have a builder it will remove all the unneccesery files (Readme's, make files, tests, documentation etc.)
dcohenb
  • 2,099
  • 1
  • 17
  • 34