-
Notifications
You must be signed in to change notification settings - Fork 262
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
fixes esm exports #1269
fixes esm exports #1269
Conversation
@@ -18,7 +18,8 @@ | |||
}, | |||
"browser": { | |||
"types": "./build/lib/index.d.ts", | |||
"import": "./build/esm/browser/index.js" | |||
"import": "./build/esm/browser/index.js", | |||
"default": "./build/esm/browser/index.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.
jest@28
updated it's resolver algorithm, jest will now resolve the "default"
export
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.
jest@28 starts using the esm bundle by default? or config will be needed?
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.
I'm not sure it prioritizes esm bundle specifically (jest considers it's esm support to be experimental), but it changed the preference of which exports it consumes.
(I turned off the moduleMapper
config when testing this)
More info here: #1268
@@ -98,7 +98,10 @@ fs.writeFileSync(`${BUILD_DIR}/package.json`, JSON.stringify(packageJSON, null, | |||
|
|||
// Add an extra package.json underneath ESM to indicate module type | |||
// This helps tools like Jest identify this code as ESM | |||
// (name and version are required for MFE) |
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.
This version of auth-js fails Module Federation builds (via webpack 5). Seems related to webpack/webpack#13457. Adding name
and version
to this "dummy" package.json
fixes the issue
May resolve #1270 as well |
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.
please also add changelog
16f1d2b
to
8406358
Compare
This reverts commit 2c66e80.
OKTA-529463 fix: use umd bundle as browser default
No description provided.