J
J
Jekins D&D2015-08-21 18:55:09
Building projects
Jekins D&D, 2015-08-21 18:55:09

How to build a project with Grunt or Gulp according to the described rules?

Good day.
Let me explain the situation first and then the question. There is one large project, which includes subprojects, we want to make one common base with css, js, images and fonts, but when building a separate subproject, only the necessary files from the common base should be collected into it, and not all of it. Scripts, styles, fonts, we store in a modular version, for example: css(head.css, nav.css, article.css); js(menu.js, side.js) and so on, this is a very rough example, but I think the point is clear.
So, is it possible to create build rules for a grant or a gallp? Don't write something like this:

uglify: {
  files: {
    'dist/js/scripts.min.js': ['src/js/*.js']
  }
}

and for example, in each subproject, there would be a JSON file that describes the paths only to the necessary files for this subproject and somehow transfer this rule to a grant or galp for assembly.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Arutyunov, 2015-08-21
@Jekins

Haven't looked in the direction of such a plugin: stackoverflow.com/questions/13694385/can-i-have-mu... ?
https://github.com/shama/grunt-hub

S
Sergey, 2015-08-21
Protko @Fesor

moduleA.less - includes everything needed for module A
moduleA.js - includes everything needed for module B. Compile via esperanto or whatever.
There are assemblers like the same webpack that can resolve everything in general.
you got the idea.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question