Open tophf opened 1 month ago
Here's the diff after moving to src which makes more sense for online browsing: https://github.com/openstyles/stylus/pull/1828/files/b4aa1c4d4a2b13ff778dcf16f7b1e57591787394..HEAD
I have never used webpack either so I can only tell from my rollup experience:
src/package.json
. Is that how babel config works?static
folder to simplify the config for CopyPlugin
.export
to the source.createElement
and addEventListener
.Here are some examples using rollup:
manifest.json
, options.html
, etc. https://github.com/eight04/ansi-viewer/blob/master/rollup.config.jsGreat stuff, thanks.
duplicated code
I had to split the worker scripts manually into separate compilation items in webpack (previously did the same in rollup) to reuse the code, but comlink should greatly simplify it, thanks.
The content script is intentionally a single bundle because only ~600 bytes for msg-base
are duplicated, which isn't worth extracting.
src/package.json
Dunno yet, I forgot to finish my investigation about it. I'll probably remove it, if the extra re
plugin doesn't break node_modules and doesn't slow down compilation.
Seems to work, but I didn't test everything, so I plan to publish it only into beta for a while. Editor/manager now open slightly faster, as expected, due to bundling and minifying dozens of scripts.
Todo:
@eight04, now the source code is using modern conventions (more or less), so it's easier to work with, especially in nontrivial ways. I'll be primarily working on MV3 (arguably using conditional compilation, I don't know yet), so maybe you could take a look at this PR as a whole and advise or participate. Since I don't have a lot of experience in tooling, there's probably a lot to improve. BTW I've tried rollup and although it produced nice ES modules, I still switched to webpack because it's much more flexible at about the same speed. Regarding all those WIP commits, I won't merge them, I'll rebase/regroup everything or just squash it in one commit later.