Skip to content

Drop, Replace, Inline, DIY, or Minimize Dependencies #2523

Description

@aklinker1

Feature Request

I really want to decrease the size of WXT. As of 0.21.2, here's it's install size (excluding peers):

22MB / 156 packages

There's a couple options for cleaning these up:

  1. Is the dependency actually needed anymore? No? Drop it
  2. Can the dependency be replaced with a smaller alternative? Yes? Do it
  3. Is the dependency small and not likely to have a vulnerability? Yes? Inline it
  4. Is the dependency something that can be replaced by a single function? Yes? DIY it
  5. After reviewing, could the package be cleaned up? Yes? Contribute to it

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

Medium Priority

Low Priority

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions