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: Fixes ESM build for Node.js #1462

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 7.5.0

### Bug Fix

- [#1462](https://github.com/okta/okta-auth-js/pull/1462) Fixes ESM build for Node.js

### Other

- [#1449](https://github.com/okta/okta-auth-js/pull/1449) chore: bump `broadcast-channel` version to `5.3.0`
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function createPackageJson(dirName) {
generateBundle() {
// Add an extra package.json underneath ESM to indicate module type
// This helps tools like Jest identify this code as ESM
if (!existsSync(dirName)){
if (!existsSync(dirName)) {
mkdirSync(dirName, { recursive: true });
}
writeFileSync(`${dirName}/package.json`, JSON.stringify({
Expand All @@ -89,7 +89,7 @@ const getPlugins = (env, entryName) => {
let plugins = [
replace({
'SDK_VERSION': JSON.stringify(pkg.version),
'global.': 'window.',
...(env === 'browser' && { 'global.': 'window.' }),
preventAssignment: true
}),
(env === 'browser' && alias({
Expand Down Expand Up @@ -120,7 +120,7 @@ const getPlugins = (env, entryName) => {
}
}
}),
multiInput({
multiInput({
relative: 'lib/',
}),
createPackageJson(outputDir)
Expand Down