nystudio107 / annotated-webpack-config

This is the companion github repo for the "An Annotated webpack 4 Config for Frontend Web Development" article.
https://nystudio107.com/blog/an-annotated-webpack-4-config-for-frontend-web-development
MIT License
436 stars 75 forks source link

PostCSS loader URL #25

Open TomDeSmet opened 4 years ago

TomDeSmet commented 4 years ago

I just spend hours looking for a solution why my woff font files didn't get loaded. Turns out, in the latest webpack.dev.js file in the postCSS loader config you disable the url()function of CSS: https://webpack.js.org/loaders/css-loader/#url

Turning this on solved my issue. I guess this also disabled the use of background-image in CSS.

Is this a bug or a feature? And if the latter, why?

karensg commented 4 years ago

You probably upgraded css-loader to version 3. They inverted the values in the config: https://github.com/webpack-contrib/css-loader/releases/tag/v3.0.0