I have a node.js application with package.json which in turn have devDependencies and dependencies. The node application also has tests.
In the build machine, I run 'npm install' so that dev-dependencies are installed, then tests are run (tests need dev-dependencies). Then a zip is created with all node_modules and other needed files. Note that the node_modules dir contains all dev-dependencies as well.
My desire is to zip and package only the production-dependencies (and exclude the dev-dependencies). So, what should I do?
If I set NODE_ENV=production then my dev-dependencies do not get installed and this halts the build. If I package the entire node_modules dir, then I am packaging the dev-dependencies also.
What is the best approach for building and packaging for production? Thanks.