Skip to content

Inject.setModuleRoot breaks window.define #315

@straker

Description

@straker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions