As part of my build / CI process in TeamCity, I would like to specify the set of JavaScript files mentioned in my HTML and merge them into one.
In other words, this is what I would like to accomplish.
Before:
<script src="1.js" /> <script src="2.js" />
After
<script src="combined.js" />
I am looking for a command line tool to combine 1.js and 2.js in integ.js. Then, a command line tool (or perhaps the same tool) to replace the links in the HTML file with this new file. Please tell me how I could do this.
What I have tried so far:
I watched grunt-usemin , which looks good, but requires the build server to run npm install for each build in order to get the dependencies, then run it. This takes too much time and is not a good solution, because we often install + deployment.
I know that I could add my node_modules folder to git, but this is also undesirable. It would be nice if grunt could run these modules installed all over the world, but this is not a rough way (if I am not mistaken, wants to grunt everything to be installed locally).
Someone also suggested running grunt on developer machines. Again, this is undesirable, since we have temporary VMs, and this will disrupt the flow of development.
It would be nice if I could use rununt-usemin without any problems!