@@ -27,13 +27,6 @@ module.exports = class DojoAMDModuleFactoryPlugin {
27
27
28
28
apply ( compiler ) {
29
29
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
- */
37
30
compiler . plugin ( "normal-module-factory" , ( factory ) => {
38
31
const context = Object . create ( this , { factory : { value : factory } } ) ;
39
32
plugin ( factory , {
@@ -42,14 +35,14 @@ module.exports = class DojoAMDModuleFactoryPlugin {
42
35
"add absMids from request" : this . addAbsMidsFromRequest , // plugin specific event
43
36
"before-resolve" : this . beforeResolve ,
44
37
"resolver" : this . resolver ,
45
- "create-module" : this . createModule ,
46
- "module" : this . module
38
+ "create-module" : this . createModule
47
39
} , context ) ;
48
40
compiler . plugin ( "compilation" , ( compilation , params ) => {
49
- Object . defineProperties ( context , {
41
+ var context2 = Object . create ( context , {
50
42
compilation : { value : compilation } ,
51
43
params : { value : params }
52
44
} ) ;
45
+ plugin ( factory , { "module" : this . module } , context2 ) ;
53
46
} ) ;
54
47
} ) ;
55
48
}
0 commit comments