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(terser): don't assume code is running in worker created by the worker pool #1483

Merged
merged 2 commits into from
May 16, 2023

Conversation

dasa
Copy link
Contributor

@dasa dasa commented Apr 20, 2023

Fixes issue shown at https://github.com/dumbmatter/rollup-terser-worker-threads by making sure the worker code is only executed when the worker was created by the worker pool.

Rollup Plugin Name: terser

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no (I don't see a good way to test for this change, but the current tests are testing for regressions.)

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers: #1482

Description

Currently the worker only checks if it's not running on the main thread and then assumes that if it it isn't, it was created by the worker pool. This isn't true when Rollup itself is being run in a worker.

@shellscape shellscape merged commit 4e92bc2 into rollup:master May 16, 2023
@shellscape
Copy link
Collaborator

thanks!

@dasa dasa deleted the dasa/terser-rollup-in-worker-fix branch May 16, 2023 16:12
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.

3 participants