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

fix: background scripts for firefox build #790

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

VadimSaveljev
Copy link
Contributor

@VadimSaveljev VadimSaveljev commented Sep 25, 2023

This is a follow up to #776
I tried it out and the firefox build ignores background scripts, this PR fixes it

@changeset-bot
Copy link

changeset-bot bot commented Sep 25, 2023

🦋 Changeset detected

Latest commit: 56abaad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@crxjs/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
vite-plugin-docs ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2023 1:39pm

@Chimildic
Copy link

@jacksteamdev can you add the request to npm version?

@fbjorn
Copy link

fbjorn commented Oct 6, 2023

Hi @SaltyCucumber , can this PR by any chance fix #801 ? And have you experienced this problem with Firefox at all?
Seems like this plugin generates top level service-worker-loader.js that imports other files, but Firefox doesn't support imports.
There's even a comment about that: https://github.com/crxjs/chrome-extension-tools/blob/main/packages/vite-plugin/src/node/plugin-background.ts#L69
But as far as I can see, the line above only affects development mode, not the built files

@VadimSaveljev
Copy link
Contributor Author

VadimSaveljev commented Oct 7, 2023

Hi @SaltyCucumber , can this PR by any chance fix #801 ? And have you experienced this problem with Firefox at all? Seems like this plugin generates top level service-worker-loader.js that imports other files, but Firefox doesn't support imports. There's even a comment about that: https://github.com/crxjs/chrome-extension-tools/blob/main/packages/vite-plugin/src/node/plugin-background.ts#L69 But as far as I can see, the line above only affects development mode, not the built files

Are you trying to use a dev build with HMR?
The code I'm updating in this PR fixes the prod build.
Dev build on firefox doesn't work with or without this PR.

@Stevenkhalife
Copy link

@jacksteamdev This PR fixes some issues in #776 where the background script was being completely ignored on build. Can we merge and deploy it asap so that we can benefit from the newly introduced Firefox support?

@jacksteamdev
Copy link
Contributor

@SaltyCucumber @Stevenkhalife I've done a code review but haven't had time to test this live. If there are any bugs, it's up to the community to make a PR. Thanks for the contributions!

@jacksteamdev jacksteamdev merged commit f5c4bd7 into crxjs:main Oct 16, 2023
1 check passed
@VadimSaveljev VadimSaveljev deleted the fix-background-firefox branch October 16, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants