I’ve completed a basic working port of Babylon.js ported to use Rollup instead of Gulp + Webpack. You can see my ongoing work at https://github.com/Symbitic/Babylon.js. When it’s complete, Gulp can be removed entirely, and Webpack can be used for just the web applications.
It’s not feature complete yet. It doesn’t build the web apps. It doesn’t build minified yet. It doesn’t handle linting or emitting typescript definitions. And it doesn’t bundle all the separate modules (Core, Gui, Loader, etc) into a single file for single distribution. I’m working on it.
Why use Rollup
Right now, Babylon is tightly integrated with its build system. That hampers maintainability.
Rollup generates much smaller bundles than Webpack. It can also handle building multiple formats at once.
It also means we can transition away from that Gulp + Webpack mess Babylon currently uses. Rollup builds with just one command:
$ npm run build. And since Rollup is installed automatically, that means no more globally-installed packages.
The only two files used for the entire build process are
rollup-plugin-babylon.js in the root directory. Try checking them out - I don’t even need to use the
npm run build. That’s it.
Files are placed in
./dist/rollup/. I added this directory to
.gitignore, since I really don’t think repos should be committing built files - they should be using NPM and a CDN like UNPKG for that.
I have tested (though not extensively), and both the ES6 and UMD modules for Core can be loaded in Node.js, though the others (GUI, Loader) don’t work only because they require the “babylonjs” module installed (which it isn’t during development). The UMD modules for Core, GUI, Loaders, and all others load successfully in the browser and are available under the usual BABYLON.
Obviously, I plan to add things like minified builds soon.
I hope to start porting things like linting, testing, type emitting and typedoc away from Gulp tasks and to NPM scripts, IF the developers are okay with that.
I am hoping to submit a pull request soon, if the developers are okay with it. But first, I would like to get feedback.
Do people think this is a good idea to begin with? Is there something I should change?
I welcome any and all feedback.