File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -170,14 +170,15 @@ interface LegacyModule extends Module {
170170 userRequest ?: any ;
171171}
172172
173+
173174const normalModuleLoaderHook = (
174175 { moduleAssets } : { moduleAssets : Record < any , any > } ,
175- loaderContext : LoaderContext < any > ,
176+ context : unknown ,
176177 module : LegacyModule
177178) => {
179+ const loaderContext = context as LoaderContext < any > ;
178180 const { emitFile } = loaderContext ;
179181
180- // eslint-disable-next-line no-param-reassign
181182 loaderContext . emitFile = ( file : string , content : string , sourceMap : any ) => {
182183 if ( module . userRequest && ! moduleAssets [ file ] ) {
183184 Object . assign ( moduleAssets , { [ file ] : join ( dirname ( file ) , basename ( module . userRequest ) ) } ) ;
Original file line number Diff line number Diff line change 11import { relative , resolve } from 'path' ;
22
33import { SyncHook } from 'tapable' ;
4- import { Compiler , WebpackPluginInstance , Compilation } from 'webpack' ;
5- // @ts -ignore
6- import NormalModule from 'webpack/lib/NormalModule' ;
7-
4+ import type { Compiler , WebpackPluginInstance , Compilation } from 'webpack' ;
85import { FileDescriptor } from './helpers' ;
96import { beforeRunHook , emitHook , getCompilerHooks , normalModuleLoaderHook } from './hooks' ;
107
@@ -71,6 +68,7 @@ class WebpackManifestPlugin implements WebpackPluginInstance {
7168 }
7269
7370 apply ( compiler : Compiler ) {
71+ const { NormalModule } = compiler . webpack ;
7472 const moduleAssets = { } ;
7573 const manifestFileName = resolve ( compiler . options . output ?. path || './' , this . options . fileName ) ;
7674 const manifestAssetId = relative ( compiler . options . output ?. path || './' , manifestFileName ) ;
You can’t perform that action at this time.
0 commit comments