I'm currently developing a web-app using node/npm and grunt. I'm new to web-development and come from java development. This is how my prototype's structure looks like:
prototype
|--app
|--index.html
|--index.js
|--dist
|--index.html
|--index.js
|--lib (currently empty)
|--Gruntfile.js
|--package.json
I plan on developing with following structure: My code will be modularized by using npm modules in the lib
folder. Those will be included in the index.js
. The index.html
and index.js
files in the app
folder will be built for the browser using grunt-browserify
and grunt-contrib-copy
; results will be put into the dist
folder. I also plan on using bootstrap.
In the bootstrap starting-guide, there is written (source), grunt dist
would regenerate the dist
folder with bootstrap included.
My first question is: How does that happen? I guess you have to place the bootstrap folders somewhere. Or do I need to install some bootstrap related package? In short: How does grunt "know about" bootstrap?
My second question is: How could I include this process in my gruntfile? Right now my gruntfile uses browserify to browserify the index.js and copy to copy the index.html. Those are registered at the goal (is this the right term?) default
: grunt.registerTask('default', ['browserify', 'copy', ]);
. I'd like to alter this goal by adding the bootstrap magic that happens in grunt dist
.
Any help is much appreciated!