Skip to content

Commit

Permalink
Add a worker condition to @emotion/cache (#2842)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Aug 2, 2022
1 parent ed9b061 commit 28e9b49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tame-cheetahs-roll.md
@@ -0,0 +1,5 @@
---
'@emotion/cache': patch
---

Thanks to the recently added `exports` field, the package now includes a `worker` condition that can be utilized by properly configured bundlers when targeting worker-like environments. It fixes the issue with browser-specific files being prioritized by some bundlers when targeting workers.
4 changes: 3 additions & 1 deletion packages/cache/package.json
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"module": {
"worker": "./dist/emotion-cache.worker.esm.js",
"browser": "./dist/emotion-cache.browser.esm.js",
"default": "./dist/emotion-cache.esm.js"
},
Expand Down Expand Up @@ -46,7 +47,8 @@
"preconstruct": {
"exports": {
"envConditions": [
"browser"
"browser",
"worker"
]
}
}
Expand Down

0 comments on commit 28e9b49

Please sign in to comment.