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

Compatibility with webpack #123

Closed
Offirmo opened this issue Aug 29, 2017 · 3 comments
Closed

Compatibility with webpack #123

Offirmo opened this issue Aug 29, 2017 · 3 comments

Comments

@Offirmo
Copy link

Offirmo commented Aug 29, 2017

The UMD template from here https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js is not consumed properly in webpack 2.

See my S/O question here: https://stackoverflow.com/questions/45929231/how-to-consume-an-umd-module-with-webpack

I suggested an improvement to the UMD template. What do you think?

@bonebizz21
Copy link

Thank

@SimonHeimberg
Copy link

did maybe #125 fix this issue as well? (It uses self if it exists and this else)

Your work around simply skips defining the global object if the root object does not exist.
So maybe you could use the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExports.js which only defines the global when used in the browser.

@Offirmo
Copy link
Author

Offirmo commented Jun 16, 2022

Wow thanks for the answer!
However it was in 2017 and webpack 2 is long gone.
I'll close this issue, anyone experiencing a similar problem is welcome to open a new one.

@Offirmo Offirmo closed this as completed Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants