Skip to content

Rollup code splitting question relating to Vite/WXT #1352

Answered by aklinker1
npearson72 asked this question in Q&A
Discussion options

You must be logged in to vote

I looked this up and understand now. But as a follow-up, what currently happens? Does WXT bundle all content scripts (and their dependencies) into a single chunk?

Or is that each content script is it's own chunk, but includes all the dependencies it needs; creating duplication?

No, each content script is built individually, bundled into the IIFE format.

You can see the build steps in WXT's CLI:

  1. Background is bundled individually:
  2. The one content script is bundled individually:
  3. The popup is bundled individually. In this case, there are no other HTML pages, so it's alone.

If you want to know the specifics of what types of entrypoints are grouped together into a single build vs what a…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@npearson72
Comment options

@aklinker1
Comment options

Answer selected by npearson72
@npearson72
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants