webpack-contrib / mini-css-extract-plugin

Lightweight CSS extraction plugin
MIT License
4.67k stars 388 forks source link

will ABSOLUTE_PUBLIC_PATH("webpack:///mini-css-extract-plugin/") be appended with font url by default? #936

Closed muthumanig closed 2 years ago

muthumanig commented 2 years ago

will ABSOLUTE_PUBLIC_PATH("webpack:///mini-css-extract-plugin/") be appended with font url by default? eg: url(../fonts/) -> url(webpack:///mini-css-extract-plugin//fonts/)

alexander-akait commented 2 years ago

Please use the issue template

yoannmoinet commented 2 years ago

Hi there :wave:

Since it's the only mention of the issue from Google I'm commenting here so others may find a solution.

I had the same problem, with mini-css-extract-plugin version 2.6.0 and webpack version 5.72.1 where on the urls of external assets (fonts) there was this prefix of webpack:///mini-css-extract-plugin/.

I fixed it by setting experimentalUseImportModule to false in the plugin's options:

new MiniCssExtractPlugin({
    experimentalUseImportModule: false
})
yoannmoinet commented 2 years ago

Created https://github.com/webpack-contrib/mini-css-extract-plugin/issues/945

alexander-akait commented 2 years ago

Closed in favor https://github.com/webpack-contrib/mini-css-extract-plugin/issues/945