digitalevidencetoolkit/deptoolkit

Rewrite browser extension: TS, no Webpack

basilesimon opened this issue ยท 5 comments

Rewrite browser extension: TS, no Webpack
edsu commented

Sorry for the interruption: does using TyoeScript mean you no longer need Webpack to bundle for the browser?

Hey Ed, thanks for stopping by ๐Ÿ‘‹

I'd love to do away with Webpack, if I'm honest. Doesn't really feel right to be installing 800+ packages for a browser extension...

This part of the plumbing, so to speak, isn't really my cup of tea, hence the help wanted tag ๐Ÿ™‚

Would you happen to have thoughts or knowledge of these things, by any chance?

There's this rather feature-full template, which includes TypeScript (yay) but also React (uh), Babel (er), and Webpack (ah...). That's about 1,500 packages to install to run it...

edsu commented

I totally understand, and is exactly why I was asking :-) I've been meaning to switch over to using TypeScript and was wondering if it made some of the Webpack bloat go away.

I think one approach to doing away with Webpack while still using components is to use the browser's native support for custom elements. I think libraries like lit-element help with that. Packaging with Webpack or Rollup sneak back into the picture once you need to import another module. But if your browser extension doesn't really have any dependencies that need to be bundled along with it maybe this approach would work?

But if your browser extension doesn't really have any dependencies that need to be bundled along with it maybe this approach would work?

I know, it's tragic isn't it! A big reason for adding Webpack support was to offer a nicer dev experience, which quite frankly benefits from in-browser hot reloading without having to re-import your manifest into the browser...