chore: migrate from manually inling ical.js to importing the node_module
Currently, we download and put ical.js in the repository manually.
Turns out they now have (or I just missed it before) a package on npm for this. We should depend on that instead, and use a bundler to insert it into the add-on.
This will require some investigation as I'd like the build to be untouched output. As in:
- All files in
src/must appear in the build as-is. - Then node_modules pulled in like
ical.jsmust be minified with Copyright notices preserved. - I'd like to include certain files like
LICENSEin the build output as well.
I've reviewed other Thunderbird add-ons that use bundlers, and it seems that anything will work for us. Babel, Rollup, Vite, esbuild, etc.
I'd prefer to use one that has very few features out of the box.
Rollup
I've already tried doing this with Rollup, and while I made progress, it was pretty painful to get the precise output I wanted. For example, I'm still unsure how to use terser() to only minify node_modules, but not src/.
Babel
We already have Babel in our yarn.lock, but it's intended for transpiling more so than as a general build tool.
I looked deeper into it just in case it has other uses, but nah I don't think Babel would work.
Vite
We could use this, but under the hood it uses Rollup anyway. So it might be better to just stick to Rollup.