Skip to content

feat: add @wxt-dev/entrypoint-refs package#2464

Open
silverfish2525 wants to merge 1 commit into
wxt-dev:mainfrom
silverfish2525:feat/entrypoint-refs-v2
Open

feat: add @wxt-dev/entrypoint-refs package#2464
silverfish2525 wants to merge 1 commit into
wxt-dev:mainfrom
silverfish2525:feat/entrypoint-refs-v2

Conversation

@silverfish2525

Copy link
Copy Markdown
Contributor

Summary

  • add @wxt-dev/entrypoint-refs package — generates typed bundle-path constants for every entrypoint
  • new optional ref?: string on BaseEntrypointOptions — stable identifier that survives file renames
  • alias #entrypoints registered automatically when the module is set up
  • all entrypoint types included (HTML pages, content scripts, background, etc.)
  • content scripts with a CSS sibling get a companion _CSS constant automatically
  • collisions disambiguated with a numeric suffix; skipped entrypoints excluded
// content.ts
export default defineContentScript({ ref: 'overlay', ... })

// background.ts
import { ENTRYPOINT_OVERLAY, ENTRYPOINT_OVERLAY_CSS } from '#entrypoints';
browser.scripting.registerContentScripts([{
  id: 'overlay',
  js: [ENTRYPOINT_OVERLAY],
  css: [ENTRYPOINT_OVERLAY_CSS],
  matches: ['<all_urls>'],
}]);

Tests

  • bun run --filter @wxt-dev/entrypoint-refs test run
  • bun run --filter @wxt-dev/entrypoint-refs check
  • bun run check

Closes #2040

Depends on #2463 landing first (getEntrypointBundlePath export).

@netlify

netlify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit f1985bb
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6a43a8a0f2e7990009f70b41
😎 Deploy Preview https://deploy-preview-2464--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added pkg/wxt Includes changes to the `packages/wxt` directory pkg/entrypoint-refs labels Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/entrypoint-refs pkg/wxt Includes changes to the `packages/wxt` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register a defined Content Script at runtime

1 participant