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

module dependency conflicts with NodeStuffPlugin: module.id becomes module.i #9

Open
lumen0988 opened this issue Nov 3, 2016 · 0 comments

Comments

@lumen0988
Copy link

I had a problem with module dependecy in some files which will be processed by the webpack NodeStuffPlugin.

Situation is as follows:

The dojo-webpack-loader will prepend your module body with module={id:normalizedModuleName} if you have module as AMD dependency. If you use module.id in your code this will be replaced by the NodeStuffPlugin with module.i whilst module={id:normalizedModuleName} doesn't get replaced. This leads to several undefined errors on runtime.

Solution

A solution for this is to change the prepend code to module={}; module.id = normalizedModuleName; which can be achieved by replacing line 169 in index.js with
module.inject.prepend += `${dep.name}={}; ${dep.name}.id=${JSON.stringify(module.normalizedName ? module.normalizedName : '')}`;

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

1 participant