Please do not put test harnesses or transpilers in your dependencies object
Why so adamantly? In fact, the final product we can build using CI
.
And for this reason I can not agree with the fact that grunt
, browserify
and so on are local dependencies.
The current scheme is relevant only for the server-side development, but not for the client.
Alternative scheme:
git/hooks/pre-push
#!/bin/sh
npm run jslint
npm test
package.json
{
"scripts": {
"lint": "jslint '...",
"test": "mocha '...",
"grunt": "grunt"
},
"dependencies": {
"requirejs": "2.1.22"
},
"deploymentDependencies": {
"grunt": "0.4.5",
"mocha": "2.4.5"
},
"devDependencies": {
"jslint": "0.9.6"
}
}
Local machine:
npm install
git commit -am '...'
git push origin branch # run pre-push hook
CI
npm install --production --deployment
npm run grunt build:production
npm test
rsync ... # file transfer program
I propose to add something like deploymentDependencies
as an alternative for client-side development.
So, what do you think?