@@ -59,18 +59,13 @@ class Module extends DependenciesBlock {
5959 // TODO refactor: pass as constructor argument
6060 this . context = null ;
6161 this . resolveOptions = EMPTY_RESOLVE_OPTIONS ;
62+ this . factoryMeta = { } ;
6263
6364 // Info from Build
64- this . sideEffectFree = false ;
6565 this . warnings = [ ] ;
6666 this . errors = [ ] ;
67- this . strict = false ;
68- this . meta = { } ;
69- this . exportsArgument = "exports" ;
70- this . moduleArgument = "module" ;
71- this . assets = null ;
72- this . fileDependencies = undefined ;
73- this . contextDependencies = undefined ;
67+ this . buildMeta = undefined ;
68+ this . buildInfo = undefined ;
7469
7570 // Graph (per Compilation)
7671 this . reasons = [ ] ;
@@ -89,13 +84,20 @@ class Module extends DependenciesBlock {
8984 // Info from Optimization (per Compilation)
9085 this . used = null ;
9186 this . usedExports = null ;
92- this . providedExports = null ;
9387 this . optimizationBailout = [ ] ;
9488
9589 // delayed operations
9690 this . _rewriteChunkInReasons = undefined ;
9791 }
9892
93+ get exportsArgument ( ) {
94+ return this . buildInfo && this . buildInfo . exportsArgument || "exports" ;
95+ }
96+
97+ get moduleArgument ( ) {
98+ return this . buildInfo && this . buildInfo . moduleArgument || "module" ;
99+ }
100+
99101 disconnect ( ) {
100102 this . hash = undefined ;
101103 this . renderedHash = undefined ;
@@ -115,7 +117,6 @@ class Module extends DependenciesBlock {
115117
116118 this . used = null ;
117119 this . usedExports = null ;
118- this . providedExports = null ;
119120 this . optimizationBailout . length = 0 ;
120121 super . disconnect ( ) ;
121122 }
@@ -253,9 +254,9 @@ class Module extends DependenciesBlock {
253254 }
254255
255256 isProvided ( exportName ) {
256- if ( ! Array . isArray ( this . providedExports ) )
257+ if ( ! Array . isArray ( this . buildMeta . providedExports ) )
257258 return null ;
258- return this . providedExports . indexOf ( exportName ) >= 0 ;
259+ return this . buildMeta . providedExports . indexOf ( exportName ) >= 0 ;
259260 }
260261
261262 toString ( ) {
@@ -288,6 +289,11 @@ class Module extends DependenciesBlock {
288289 }
289290
290291 unbuild ( ) {
292+ this . dependencies . length = 0 ;
293+ this . blocks . length = 0 ;
294+ this . variables . length = 0 ;
295+ this . buildMeta = undefined ;
296+ this . buildInfo = undefined ;
291297 this . disconnect ( ) ;
292298 }
293299
@@ -320,6 +326,16 @@ Object.defineProperty(Module.prototype, "chunks", {
320326 }
321327} ) ;
322328
329+ Object . defineProperty ( Module . prototype , "meta" , {
330+ configurable : false ,
331+ get : util . deprecate ( function ( ) {
332+ return this . buildMeta ;
333+ } , "Module.meta was renamed to Module.buildMeta" ) ,
334+ set : util . deprecate ( function ( value ) {
335+ this . buildMeta = value ;
336+ } , "Module.meta was renamed to Module.buildMeta" ) ,
337+ } ) ;
338+
323339Module . prototype . identifier = null ;
324340Module . prototype . readableIdentifier = null ;
325341Module . prototype . build = null ;
0 commit comments