-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feat: generate bundles for "worker" style environement #2589
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c9a1195:
|
Codecov Report
|
packages/cache/package.json
Outdated
"worker": { | ||
"production": { | ||
"module": "./dist/emotion-cache.worker.esm.prod.js", | ||
"default": "./dist/emotion-cache.worker.cjs.prod.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "module"
and "default"
instead of "import"
and "require"
as documented here? "module"
isn't a standard condition, so "default"
will always be used (i.e. no ESM support; always CommonJS).
@mitchellhamilton @Andarist I have updated this PR to use the new v2.1.8 version of preconstruct and attempted to build with the new "worker" condition enabled but I must be missing something because that specific condition is not being generated. (The browser condition is working). Any chance you could take a quick look and let me know what I did wrong? |
|
Didn't mean to close, re-created in #2819 |
What:
This is PR uses a
hopefully soon-to-be-releasednewly released version of preconstruct that support building "worker" compatible builds. The primary use-case for this is to support Cloudflare workers.Why:
See #2554
How:
I've made changes to each package in the monorepo and extended the package.json to include an "exports" field with custom conditionals for "browser" and "worker".
Checklist: