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

Use existing moduleName object for IIFE and UMD if present #493

Closed
krzksz opened this issue Feb 3, 2016 · 0 comments · Fixed by #499
Closed

Use existing moduleName object for IIFE and UMD if present #493

krzksz opened this issue Feb 3, 2016 · 0 comments · Fixed by #499

Comments

@krzksz
Copy link

krzksz commented Feb 3, 2016

Hey!
Right now rollup seems to reset module namespace every time the file is executed as seen in this example((this.myBundle = {})). This is problematic when you have multiple packages that should exist in common namespace inside window object, but some of them are lazy loaded when rarely needed. In this situation the variable will be cleared every time dynamic bundle is included.

The solution would be to slightly change the code so the generated piece would look like: (this.myBundle = this.myBundle || {}).

@krzksz krzksz changed the title Use existing moduleName object for IIFE if present. Use existing moduleName object for IIFE if present Feb 3, 2016
@krzksz krzksz changed the title Use existing moduleName object for IIFE if present Use existing moduleName object for IIFE and UMD if present Feb 7, 2016
krzksz pushed a commit to krzksz/rollup that referenced this issue Feb 7, 2016
krzksz pushed a commit to krzksz/rollup that referenced this issue Feb 7, 2016
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

Successfully merging a pull request may close this issue.

1 participant