I have this tree:
/areas
first.js
second.js
/lib
/first
stuffA.js
stuffB.js
/second
otherStuff01.js
otherStuff02.js
/utils
commonStuff01.js
commonStuff02.js
test.js
first.jsandsecond.jscontains functions that are executed intest.js;- all the files in
/lib/firstare used infirst.js - all the files in
/lib/secondare used insecond.js - files in
/lib/utilsare used in multiple places, e.g. print functions and similar.
Since the /areas folder will be enriched with a lot of files in the future, is there a smart way in JS to exports and require files in test.js to avoid a ton of require lines?
_
e.g. I want to avoid in test.js
const first = require('./areas/first')
const second = require('./areas/second')
...
I have to import other files in first.js and second.js too, so suggestions are very welcome!