Skip to content

Commit 6de8e34

Browse files
author
Chuck Dumont
authored
Merge pull request #152 from chuckdumont/work
Fix for Object.defineProperties error when using webpack-dev-server #151
2 parents d319b9d + 003635f commit 6de8e34

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/DojoAMDModuleFactoryPlugin.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ module.exports = class DojoAMDModuleFactoryPlugin {
2727

2828
apply(compiler) {
2929
this.compiler = compiler;
30-
/*
31-
* Module factories are per-compilation objects. We register our plugins using the
32-
* compiler's "normal-module-factory" event instead of the "compilation" event to
33-
* get the order of registration we need wrt other plugins, but it's safe to add
34-
* the compilation objects to the context after the fact, because the
35-
* "normal-module-factory" event will fire again for each new compilation.
36-
*/
3730
compiler.plugin("normal-module-factory", (factory) => {
3831
const context = Object.create(this, {factory: {value: factory}});
3932
plugin(factory, {
@@ -42,14 +35,14 @@ module.exports = class DojoAMDModuleFactoryPlugin {
4235
"add absMids from request" : this.addAbsMidsFromRequest, // plugin specific event
4336
"before-resolve" : this.beforeResolve,
4437
"resolver" : this.resolver,
45-
"create-module" : this.createModule,
46-
"module" : this.module
38+
"create-module" : this.createModule
4739
}, context);
4840
compiler.plugin("compilation", (compilation, params) => {
49-
Object.defineProperties(context, {
41+
var context2 = Object.create(context, {
5042
compilation: {value: compilation},
5143
params: {value: params}
5244
});
45+
plugin(factory, {"module": this.module}, context2);
5346
});
5447
});
5548
}

0 commit comments

Comments
 (0)