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

why change UMD global structure #1750

Closed
jasonChen1982 opened this issue Nov 21, 2017 · 5 comments
Closed

why change UMD global structure #1750

jasonChen1982 opened this issue Nov 21, 2017 · 5 comments

Comments

@jasonChen1982
Copy link

jasonChen1982 commented Nov 21, 2017

i upgrade rollup from 0.36.4 to 0.51.2, and my library can't work as before.
when i use this umd-bundle , the new bundle had cover the XXX object which i defined before.

i want this UMD structure for global

(factory((global.XXX = global.XXX || {})));

but got following in new rollup, and it overwrite my window.XXX = {...} or same-series lib export the same name XXX.

(factory((global.XXX = {})));
@lukastaegert
Copy link
Member

lukastaegert commented Nov 26, 2017

Maybe Rollup’s extend option is what you are looking for? We just updated the documentation with a little more information https://rollupjs.org/#advanced-functionality

@jasonChen1982
Copy link
Author

which extend option ? i can't find this config ~

my problem is, how to do the UMD bundle work with same name-space. not include an external-lib.

i suggest to keep following compatibility writing

(factory((global.XXX = global.XXX || {})));

@lukastaegert
Copy link
Member

This one:
extend-option

@jasonChen1982
Copy link
Author

bravo

@adrianheine
Copy link
Contributor

Can this be closed?

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

4 participants