N
N
nepster-web2015-08-12 01:54:25
Grunt.js
nepster-web, 2015-08-12 01:54:25

How to build frontend (dev and prod)?

My story begins with the fact that there are millions of different widgets, plugins and extensions for the front-end, projects require beautiful and thoughtful interfaces: custom form elements, scrollers, sliders and much more. There is a lot of such goodness, and 1000 stars on the github is far from an indicator of a cool plugin, since there can be a lot of bugs with a label like "Help Needed".
Once, on one project, it took me several months just to sort through more than 200 different plugins and find those that really work everywhere, in all perversions and are easily customized for various needs.
Therefore, I decided to make such a blank for myself from a set of high-quality widgets. Having such a preparation, it would be possible to easily start a project and compile only the required list.
I want to use the following things:
npm and bower as
grunt package managers to build
less
and various plugins and widgets.
The structure is as follows:

bower_components/
build/
node_modules/
src/
bower.json
Gruntfile.js
package.json

src - here I plan to develop my entire creation. That is, I need to properly configure Gruntfile.js so that the whole thing is assembled on command. And it already happened that I need 2 versions of the assembly.
build - but the total of everything should already fall here. That is, if everything is in src , then only what is needed for the project will get into build (for example, 5 specific plugins out of 10 collected in 1 file).
That is, in theory, I want to come to this:
src/ - a development dump that demonstrates everything everything everything .
build/ - contains widgets.js, widget.css and jquery.js, where widgets.js and widget.css is a build of all the plugins we are interested in in our new project.
The question arises:
All the dependencies that I specified fall into bower_components , now I need to drag the necessary files into the src folder. And then somehow using other commands to collect only the necessary files in the build folder . That is, is it possible to implement something like grunt build dev and grunt build prod somehow in grunt ?
Or maybe there are other ways?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question