Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip content script loader during build if it has no imports #996

Open
jaskp opened this issue Mar 10, 2025 · 1 comment
Open

Skip content script loader during build if it has no imports #996

jaskp opened this issue Mar 10, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@jaskp
Copy link

jaskp commented Mar 10, 2025

Describe the problem

Content script loader prevents the content script from running synchronously in production even if there are no imports.

Describe the proposed solution

Title pretty much says it all, I've seen samrum/vite-plugin-web-extension do this. If the content script doesn't import anything, then I think the loader should be unnecessary in build. In dev, I believe it's still needed for HMR.

Alternatives considered

Do this manually in userland, i.e. write a CrxPlugin that finds the path to the actual content script (which the content script loader imports) and rewrite the manifest to point to it directly

Importance

would make my life easier

@jaskp jaskp added the enhancement New feature or request label Mar 10, 2025
Copy link
Contributor

⚠️ Important Notice: CRXJS is seeking new maintainers.

  • New issues and PRs may not receive immediate attention
  • A new maintenance team must establish itself by March 31, 2025 or this repository will be archived on June 1, 2025
  • Learn more about the transition

This is an automated message. Please do not reply to this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant