Answer the question
In order to leave comments, you need to log in
Combining JS files into one?
Hello! Perhaps this topic has already been discussed many times, but could you suggest a library for nodeJS to combine similar JS files:
//#include init.js
//#include config.js
init(function () {
config();
});
Answer the question
In order to leave comments, you need to log in
I'll offer my suggestion -
$ npm install includejs -g
$ ijs import -files myfile.js -output done.js
# или так, все файлы в дериктории:
$ ijs import -files builds/*.js -output lib/
github.com/mape/connect-assetmanager
github.com/mishoo/UglifyJS/
github.com/gruntjs/grunt-contrib-concat (needs grunt)
You can look at the Yandex operating time - borschik , it roughly does this.
You can use grunt for this purpose. I wrote a small homemade.js lib that does exactly what you need (there was exactly the same task). It works both as a plugin for grunt and through the console. Just start node homemade.js input.js output.js
. In general, the component approach through component
is gaining popularity now , but it takes time to learn.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question