Answer the question
In order to leave comments, you need to log in
How to assemble a JS object from several files according to a template?
Is there any tool that allows you to do this:
there is a main.js target file that defines an object or function, like this:
main('jquery', function($) {
let script = {
init () {
{{init.js}}
}
load () {
{{load.js}}
}
render () {
{{render.html}}
}
};
return script;
});
Answer the question
In order to leave comments, you need to log in
So now nobody writes. Don't reinvent the wheel.
Use ES6 modules and Webpack .
Judging by the need to render html , you should look towards modern front-end frameworks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question