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 CDN build targets #270

Merged
merged 2 commits into from
Jan 25, 2022
Merged

Fix CDN build targets #270

merged 2 commits into from
Jan 25, 2022

Conversation

smithki
Copy link
Contributor

@smithki smithki commented Jan 25, 2022

📦 Pull Request

An error was introduced in #220 which mistakenly moved CDN constructor references to .default. This is due to prevailing conventions around ESM/CJS interoperability. We've resolved the issue by explicitly assigning window.{globalName}.default to window.{globalName}. This change only affects IIFE targets (i.e.: those consumed via CDN).

@smithki smithki self-assigned this Jan 25, 2022
// This snippet replaces `window.{name}` with
// `window.{name}.default`, with any additional named exports
// assigned. Finally, it removes `window.{name}.default`.
js: `if (${options.name} && ${options.name}.default != null) { ${options.name} = Object.assign(${options.name}.default, ${options.name}); delete ${options.name}.default; }`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooofduuh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I hate it. But it works...

@smithki smithki added the patch Increment the patch version when merged label Jan 25, 2022
@smithki smithki merged commit cb5bcf0 into master Jan 25, 2022
@smithki smithki deleted the smithki/fix-cdn branch January 25, 2022 23:32
@smithki smithki added the released This issue/pull request has been released. label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants