Skip to content

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