rspack icon indicating copy to clipboard operation
rspack copied to clipboard

Does rspack `normalModuleLoader` plan to align `beforeLoaders` and other hooks with webpack 5?

Open gaoachao opened this issue 1 year ago • 6 comments
trafficstars

Current

webpack NormalModuleCompilationHooks:

Image

rspack js side NormalModuleHooks:

Image

My Confusion

In addition, I found some code about before_loaders on the rust side, but the definition here is a litter different from webpack. Does it only need to be exported on the js side before it can be used? Please forgive me if my understanding is wrong. Image

Background

My webpack project use this hooks to add some custom loader context.

compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
    NormalModule.getCompilationHooks(compilation).beforeLoaders.tap(PLUGIN_NAME, (loaders, mod) => {

gaoachao avatar Oct 05 '24 13:10 gaoachao