You'd have to use some module dependency tool, like browserify, requireJS or webpack.
You'd need to export your code's variables:
//js/source.js
var SourceComponent = 'Hello'; // what you want to export
module.exports = SourceComponent; // export that variable
You can now include your source by calling
require('js/source');
Setting this up can take a while, as you often need to make sure all dependencies are tied together, which can take a long time with large projects.
We used the webpack, which has helped, as you can “emulate” it being run in a script tag.
In webpack we imported source files like follows:
require(script!js/source.js');
which allowed us to quickly get something working.