I have a set of interdependent Node.js modules that I have been building as ES6 modules, and I would ideally like to be able to specify a single module as an entry point and have these built (using grunt) into a single file which can be required by a Node application.
grunt-babel does not seem to be able to handle this packaging.
I know that browserify can do this for the browser, and I know browserify can include Node modules, but I haven't been able to figure out how to have browserify transform the single module entry point into a require-able Node module.
So, if my source file (and entry point), src/hello.js
were:
import world from './world.js';
export default function () {console.log('Hello' + world + '!');};
and src/world.js
were:
export default 'world';
I'd like it to be able to use it from a normal Node application like:
var hw = require('./dest/hello-world.js');
hw();
What would my grunt file need to look like?