I'm having some difficulty with using grunt as part of our build process. We're using a TeamCity server to run a grunt command prior to deployment. Essentially we want to be able to check in un-minified js and css and then to get Grunt to minify it for us prior to deployment.
The problem I've got is that for every build TeamCity delete's the contents of the build file system and pull's it back out of GIT (this is good as it stops old files hanging around when we don't want them). Grunt seems to insist that all dependencies are installed locally to the GruntFile.js though.
This means that for every build I have to run npm install
. This takes ages and is really slowing down our deployment process (not to mention that fact that our proxy server doesn't seem to like this when run though team city...)
I would love to somehow install the dependencies globally and only download them once (they rarely change) and simply use these downloaded dependencies every time we build. But I can't seem to figure out how to do this?
I toyed with the idea of checking in the node_modules
folder but then I realised this contained 8800 files :O So I would prefer not to pollute the GIT repository with this.
Here's the package.json to show what dependancies we have:
{
"name": "name",
"title": "title",
"description": "description",
"version": "0.0.1",
"engines": {
"node": ">=0.8"
},
"scripts": {
"test": "grunt assemble"
},
"dependencies": {
"assemble": "^0.4.42",
"css-parse": "^1.5.3",
"globule": "^0.2.0",
"grunt": "~0.4.2",
"grunt-combine-media-queries": "^1.0.19",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.3.0",
"grunt-contrib-connect": "^0.6.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-jshint": "^0.8.0",
"grunt-contrib-less": "^0.9.0",
"grunt-contrib-uglify": "^0.3.3",
"grunt-contrib-watch": "^0.5.3",
"grunt-cssshrink": "0.0.5",
"grunt-lesslint": "^1.1.7",
"grunt-modernizr": "^0.5.2",
"grunt-prettify": "^0.3.5",
"grunt-replace": "^0.6.2",
"grunt-stripmq": "0.0.3",
"handlebars-helper-repeat": "^0.2.0",
"load-grunt-tasks": "^0.2.1",
"pretty": "^0.1.2",
"time-grunt": "^0.2.10"
},
"keywords": [
"assemble",
"templates",
"handlebars",
"site generator",
"site builder",
"grunt"
]
}
I didn't actually set this up and most of my knowledge of grunt, node stems from a couple of days research so I'm not 100% sure why this is configured as it is. Open to better suggestions if something is startlingly wrong?