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(worker): fix importScripts injection breaking iife code #17827

Merged
merged 6 commits into from
Aug 6, 2024

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Aug 6, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
bartlomieju Bartek Iwańczuk
Copy link

stackblitz bot commented Aug 6, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
bartlomieju Bartek Iwańczuk

Verified

This commit was signed with the committer’s verified signature. The key has expired.
bartlomieju Bartek Iwańczuk
This reverts commit 10fb68d.
@hi-ogawa hi-ogawa changed the title fix(worker): fix injectScripts injection fix(worker): fix importScripts injection breaking iife code Aug 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
.prettierignore Outdated
@@ -11,3 +11,4 @@ playground/html/invalid.html
playground/html/valid.html
playground/external/public/slash@3.0.0.js
playground/ssr-html/public/slash@3.0.0.js
playground/worker/classic-iife.js
Copy link
Collaborator Author

@hi-ogawa hi-ogawa Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier-ignore comment doesn't seem to avoid prepending ; to (() => {})(), so I needed to prettierignore an entire file.

Technically we could test the same thing by just adding (() => {})() to existing playground/worker/classic-worker.js, but that would require prettierignore-ing that file, so I added a new file playground/worker/classic-iife.js just for this.

EDIT: On second thought, doing that seems unnecessary involved, so I went back to prettierignore-ing existing classic-worker.js.

This reverts commit 70c746c.
@hi-ogawa hi-ogawa marked this pull request as ready for review August 6, 2024 00:57
@bluwy bluwy merged commit bb4ba9f into vitejs:main Aug 6, 2024
11 checks passed
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.

TypeError: importScripts(...) is not a function when running iife-style classic worker during dev
3 participants