You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@aklinker1/rollup-plugin-visualizer (1.7MB / 23 packages, CJS) - Replace with https://sonda.dev or DIY it (how hard can it be? lol). What does nuxt's analysis tool and devtools use? OR trim down my fork to remove yargs and open
Rolldown provide's it's own bundle analysis tool, though it is experimental and this would lock us into Vite even more. We would just have to render a UI: https://rolldown.rs/builtin-plugins/bundle-analyzer
I got an extension working with vite's environment API, Play around with new Vite environment APIs #1046 (comment), but rollup-plugin-visualizer didn't work when building in series, only in parallel, meaning it's getting lucky with a race condition. So my fork is still necessary
Medium Priority
open (83KB / 12 packages, ESM) - Replace with tiny-open?
@webext-core/fake-browser (1.1MB / 6 packages, ESM) - Simplify the base object to a proxy
c12 (404KB / 8 packages, ESM) - There's a lot of dependencies here that probably aren't required for our use-case. Might want to DIY it now that node can import TS files
unimport (3MB / 30 packages, ESM) - No idea how this can be simplified, but it should be. Probably would need to contribute to it.
Fine As-is
@1natsu/wait-element (46KB / 3 packages, ESM) - Small enough as-is, though I would like to see it have 0 dependencies
@webext-core/isolated-element (13KB / 2 packages, ESM) - could DIY this
@webext-core/match-patterns (9.9KB / 1 package, ESM) - small, zero deps, it's fine
@wxt-dev/browser (870KB / 4 packages, ESM) - Fine, kinda big, but not much can be done about it
cac (41KB / 1 package, ESM) - Fine, could inline it, but it's fine.
chokidar (105KB / 2 packages, ESM) - fine for now. readdirp doesn't seem necessary anymore, could contribute to it's removal
consola (322KB / 1 package, ESM + CJS) - Kinda big, but fine for now. Don't like that it still ships CJS
defu (21KB / 1 package, ESM + CJS) - Small, could inline, but probably fine
giget (184KB / 1 package, ESM) - Kinda large, but it does it's job well.
hookable (24KB / 1 package, ESM) - Could inline, but it's fine as-is for now.
json5 (235KB / 1 package, FAUX) - Small-ish, one package, probably fine as is.
linkedom (3.6MB / 20 packages, ESM) - Parsing the entrypoint HTML files could be accomplished with htmlparser2, but I don't think the fake browser environment can be created without a library like this...
nypm (160KB / 4 packages, ESM) - We don't need it's CLI, so having to download citty is a bit of a waste, but it's not very large for the trouble.
tinyglobby (186KB / 3 packages, ESM + CJS) - Necessary, could contribute to drop CJS
Feature Request
I really want to decrease the size of WXT. As of 0.21.2, here's it's install size (excluding peers):
There's a couple options for cleaning these up:
Dependencies
This is a list of all of WXT's 37 direct dependencies, and what, if anything, we can do to reduce it's size:
High Priority
import-meta-resolve(79KB / 1 package, ESM) - Drop, not needed in Node 22import-meta-resolve#2526publish-browser-extension(933KB / 7 packages, ESM)@aklinker1/rollup-plugin-visualizer(1.7MB / 23 packages, CJS) - Replace with https://sonda.dev or DIY it (how hard can it be? lol). What does nuxt's analysis tool and devtools use? OR trim down my fork to removeyargsandopenrollup-plugin-visualizerdidn't work when building in series, only in parallel, meaning it's getting lucky with a race condition. So my fork is still necessaryMedium Priority
open(83KB / 12 packages, ESM) - Replace withtiny-open?openwithtiny-open#2527prompts(203KB / 3 packages, CJS) - Replace with@topcli/promptspromptswith@topcli/prompts#2528async-mutex(153KB / 2 packages, ESM + CJS) - replace withsuperlockasync-mutexwithsuperlock#2529@wxt-dev/storage(1.1MB / 8 packages, ESM) - Inlinedequal, replaceasync-mutexwithsuperlockasync-mutexwithsuperlock#2529dequal#2530jszip(1.8MB / 13 packages, CJS) - There's got to be a zero-dependency zip library we can replace this with...uzipis tiny and might worknode:zlibcan do it in a few lines? More than a few, but yes: https://share.gemini.google/gYafpOMSmyfozipsubprocesses 🤔fflatewas suggested: Drop, Replace, Inline, DIY, or Minimize Dependencies #2523 (comment)jszipwith@aklinker1/zero-zip#2538Low Priority
scule(30KB / 1 package, ESM + CJS) - Inline to tree-shake CJSci-info(30KB / 1 package, CJS) - Inline to tree-shake everything we don't use|ci-infowith customisCIfunction #2543get-port-please(29KB / 1 package, ESM + CJS) - Inline to tree-shake CJS outfilesize(58KB / 1 package, ESM + CJS) - Inline or DIY it. 58 kB is a bit large for a few if statements...is-wsl(10KB / 3 packages, ESM) - Is this apart ofci-info? If not, inline.normalize-path(9.2KB / 1 package, CJS) - Inline or DIYnormalize-path#2557ohash(20KB / 1 package, ESM) - Inline or DIYnanospinner(17KB / 2 packages, CJS) - Inlinenano-spawn(45KB / 1 package, ESM) - vstinyexec? don't need both,tinyexecis smaller...nano-spawnwithtinyexec#2544dotenv-expand(123KB / 2 packages, CJS) - Inlining it should remove the dependency ondotenv, will be tree-shaken out?magicast(5.3MB / 6 packages, ESM) - Only tool that includes babel, would like to replace, maybe with https://oxc.rs/docs/guide/usage/transformer.html?@webext-core/fake-browser(1.1MB / 6 packages, ESM) - Simplify thebaseobject to a proxyc12(404KB / 8 packages, ESM) - There's a lot of dependencies here that probably aren't required for our use-case. Might want to DIY it now that node can import TS filesunimport(3MB / 30 packages, ESM) - No idea how this can be simplified, but it should be. Probably would need to contribute to it.Fine As-is
@1natsu/wait-element(46KB / 3 packages, ESM) - Small enough as-is, though I would like to see it have 0 dependencies@webext-core/isolated-element(13KB / 2 packages, ESM) - could DIY this@webext-core/match-patterns(9.9KB / 1 package, ESM) - small, zero deps, it's fine@wxt-dev/browser(870KB / 4 packages, ESM) - Fine, kinda big, but not much can be done about itcac(41KB / 1 package, ESM) - Fine, could inline it, but it's fine.chokidar(105KB / 2 packages, ESM) - fine for now.readdirpdoesn't seem necessary anymore, could contribute to it's removalconsola(322KB / 1 package, ESM + CJS) - Kinda big, but fine for now. Don't like that it still ships CJSdefu(21KB / 1 package, ESM + CJS) - Small, could inline, but probably finegiget(184KB / 1 package, ESM) - Kinda large, but it does it's job well.hookable(24KB / 1 package, ESM) - Could inline, but it's fine as-is for now.json5(235KB / 1 package, FAUX) - Small-ish, one package, probably fine as is.linkedom(3.6MB / 20 packages, ESM) - Parsing the entrypoint HTML files could be accomplished withhtmlparser2, but I don't think the fake browser environment can be created without a library like this...nypm(160KB / 4 packages, ESM) - We don't need it's CLI, so having to downloadcittyis a bit of a waste, but it's not very large for the trouble.tinyglobby(186KB / 3 packages, ESM + CJS) - Necessary, could contribute to drop CJS