Answer the question
In order to leave comments, you need to log in
How to split the frontend into components?
I have one project that implements a set of widgets for a desktop-like interface: a window with a mnemonic in svg, tables, charts, panels with sets of controls. Each widget consists of one or more files - a js module with code and, sometimes, a css style. Each file contains its dependencies in the form of a homebrew solution - at the beginning of the file, the comment contains a line like:
/**
* make :: widgets.itable: webix observable widgets.itable-style
*/
;(function () {
// ... тут располагается код модуля ...
});
make
to 'u, which concatenates them in the desired sequence. For example, when assembling the fragment described above, it will see that the component widgets.itable
depends on the components webix
, observable
and widgets.itable-style
, load these components and place them higher in the text ( widgets.itable-style
it will be concatenated into a css file, by convention all names ending in -style
, are concatenated there). bower
, gulp
, grunt
, npm
, none of these things in isolation seem to do all that is needed. Maybe you should consider some bundles, like grunt+bower
?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question