Repository navigation
Switch from Gulp + Webpack to Rollup for bundling - #824
Conversation
a20ea71 to
a96b91b
Compare
|
This migration is ready to be reviewed 🎆 The export tests confirm that each entrypoint is exporting the correct things in the correct way, and I've tested it with the docs demo, and the CLI and it seems to work fine. The contents of this branch are published to meyda@beta (meyda@5.1.8-beta.1 at the moment), so I would appreciate if others could test it out and see if I've broken their projects! |
71bdb4e to
6edc69e
Compare
|
issue: gotta also upgrade the docs bundling to rollup! |
6edc69e to
930a8a3
Compare
|
Insane issue: when I bundle the docs demo implementation with rollup, and try to load the demo, my firefox browser tab crashes in Linux. No idea what might be causing this. |
|
The bundle works fine in Firefox on Windows, so I'm good with assuming that there was something interesting up with my Linux machine, and with that this PR is good from my perspective. Please weigh in if you have thoughts! |
|
Should check the Rollup support for AudioWorklet before committing to this. |
|
I've looked into Rollup support for AudioWorklet, and it's at about the same stage Webpack was at when I last looked into it. But, this time I was able to hack the rollup-plugin-web-worker-loader package to actually do a real bundle with a working AudioWorklet use that exports a commonjs bundle, so I'm confident that when we need to use AudioWorklet we'll be ok (barring the fact that the AudioWorklet constructor is asynchronous so we might have to handle that in a fun way, but we'd have to do that anyway). Yes, this is me committing to writing the rollup plugin for AudioWorklet if it comes to it! The demo is available here - and it links to the patch I applied to rollup-plugin-web-worker-loader. |
|
@2xAA has checked that this works with ModV and it does, so I'm going to go ahead with it! |
|
🎉 This PR is included in version 5.1.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I suspect that rollup is a way for us to remove both webpack and gulp. It has a nice API, I find that it's easier to use than the combination of gulp and webpack, so I think it will simplify our build a little bit. It supports UMD and cjs exports, and plugins provide node packages we use, resolve node internals, minify (using the same minifier we use in webpack), and babel transpilation. Source maps are included. I think this is all we need. Perhaps we should also bundle babel transpiled es6 modules, which would be an additional win. Currently our es6 entrypoint is just the source, which won't work for environments that for example support es6 imports but don't support the object spread operator or other newer ES features.
This isn't done though - I need to verify that what rollup outputs is close enough to what we've been shipping for all these years.