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

Inject.setModuleRoot breaks window.define #315

Open
straker opened this issue Mar 18, 2016 · 1 comment
Open

Inject.setModuleRoot breaks window.define #315

straker opened this issue Mar 18, 2016 · 1 comment

Comments

@straker
Copy link

straker commented Mar 18, 2016

Before using Inject.setModuleRoot, both window.define and Inject.define point to the same object. However, once you call Inject.setModuleRoot, they no longer are the same object so trying to configure AMD using Inject.disableAMD(true) does not work.

See my jsfiddle https://jsfiddle.net/straker/174Legs7/.

The current workaround is to either set window.define to the Inject.disableAMD return object or configure AMD before you call set the module root.

Inject.setModuleRoot('url');
window.define = Inject.disableAMD(true);

// or
Inject.disableAMD(true);
Inject.setModuleRoot('url');

However, I believe when you set the module root you should also reset the global define function to equal Inject.define again.

@jakobo
Copy link
Contributor

jakobo commented Apr 4, 2016

Thanks for the bug report. I'll see about rolling this in to the next version.

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

2 participants