Is there a way to write a main file like so:
// main.js
var foo = 'foo';
require('./bar.js'); // or import ...etc
var baz = 'baz';
// bar.js
var bar = 'bar';
then i should get this concatinated file like so:
// main.js
var foo = 'foo';
// bar.js
var bar = 'bar';
var baz = 'baz';
i don't want some side effects like wrapping the main file or exporting it, i just want a simple concatination, and indentations also should be respected.
it's just like gulp-concat but with require or import, like PHP include
I need a solution to work with Gulp or nodejs directly.