astroturf
astroturf copied to clipboard
useAltLoader doesn't work with MiniCssExtractPlugin's experimentalUseImportModule
experimentalUseImportModule
is a new option for MiniCssExtractPlugin to use importModule
instead of a child compilation.
when calling importModule
mini-css-extract-plugin prepends the request with the resource which as far as I understand adds the matchResource
to the module.
this leads to astroturf not attaching its own matchResource here
this, in turn, leads to CSS not being processed as CSS modules and then astroturf can't find any CSS Module imports since there are none
my understanding of how things work (especially in the context of matchResource) is limited and mostly comes from the discussion in your PR to css-loader so I might be mistaken here :)
also, If I comment the conditional in astroturf and just reassign this._module.matchResource = style.absoluteFilePath
unconditionally - everything seems to be working for me. I don't, however, fully understand the consequences of this action.