You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webpack 5 fails as soon as I smp.wrap() my config, with the following error:
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config
ERROR in ..../Error.scss
Module build failed (from ../../node_modules/mini-css-extract-plugin/dist/loader.js):
Error: You forgot to add 'mini-css-extract-plugin' plugin (i.e. `{ plugins: [new MiniCssExtractPlugin()] }`), please read https://github.com/webpack-contrib/mini-css-extract-plugin#getting-started at Object.pitch (.../node_modules/mini-css-extract-plugin/dist/loader.js:50:14)
webpack5 now use NormalModule.getCompilationHooks(compilation).loader instead of Compilation.hooks.normalModuleLoader, so speed-measure-webpack-plugin can not proxy it.
constcompilationHooksMap=newWeakMap();staticgetCompilationHooks(compilation){if(!(compilationinstanceofCompilation)){thrownewTypeError("The 'compilation' argument must be an instance of Compilation");}lethooks=compilationHooksMap.get(compilation);if(hooks===undefined){hooks={loader: newSyncHook(["loaderContext","module"]),beforeLoaders: newSyncHook(["loaders","module","loaderContext"]),beforeParse: newSyncHook(["module"]),beforeSnapshot: newSyncHook(["module"]),// TODO webpack 6 deprecatereadResourceForScheme: newHookMap(scheme=>{consthook=hooks.readResource.for(scheme);returncreateFakeHook(/** @type {AsyncSeriesBailHook<[string, NormalModule], string | Buffer>} */({tap: (options,fn)=>hook.tap(options,loaderContext=>fn(loaderContext.resource,loaderContext._module)),tapAsync: (options,fn)=>hook.tapAsync(options,(loaderContext,callback)=>fn(loaderContext.resource,loaderContext._module,callback)),tapPromise: (options,fn)=>hook.tapPromise(options,loaderContext=>fn(loaderContext.resource,loaderContext._module))}));}),readResource: newHookMap(()=>newAsyncSeriesBailHook(["loaderContext"])),needBuild: newAsyncSeriesBailHook(["module","context"])};compilationHooksMap.set(compilation,hooks);}returnhooks;}
when call NormalModule.getCompilationHooks(compilation) in vue-loader or mini-css-extract-plugin, smp.wrap pass proxy
compilation param, it be assign to compilationHooksMap, but webpack inner compilation is not proxy compilation , so cause that NormalModule.getCompilationHooks(compilation) is not execute
solution
so far ,i have not idea to fix this plugin. but you can modify vue-loader or mini-css-extract-plugin in node_modules
Webpack 5 fails as soon as I smp.wrap() my config, with the following error:
webpack.config.js
package.json
problem
webpack5 now use
NormalModule.getCompilationHooks(compilation).loader
instead ofCompilation.hooks.normalModuleLoader
, so speed-measure-webpack-plugin can not proxy it.vue-loader
mini-css-extract-plugin
NormalModule.getCompilationHooks(compilation)
when call
NormalModule.getCompilationHooks(compilation)
in vue-loader or mini-css-extract-plugin, smp.wrap pass proxycompilation param, it be assign to compilationHooksMap, but webpack inner compilation is not proxy compilation , so cause that
NormalModule.getCompilationHooks(compilation)
is not executesolution
so far ,i have not idea to fix this plugin. but you can modify
vue-loader
ormini-css-extract-plugin
innode_modules
vue-loader
mini-css-extract-plugin
The text was updated successfully, but these errors were encountered: