Next.js Discord

Discord Forum

How to adjust the CSS processing in NextJS 14

Unanswered
West African Lion posted this in #help-forum
Open in Discord
West African LionOP
I'm using an external SCSS package to get styling in my app. The external style sheet has reference to some assets using the css URL function (background-image: url("path/to/asset.svg");). This tries to get resolved to ./path/to/asset.svg, and fails because it can't be found. I've tried adding the assets to the SASS includePaths config within next.config, but this doesn't resolve it.
The next thing I wanted to try was to just ignore the processing of the URLs and to publish the assets. However, I can't seem to find out what is doing the processing? I'm seeing ___CSS_LOADER_EXPORT___ which makes me think it's the css-loader from webpack, but I don't see this when I look at the modules and loaders that are provided in the default webpack config.
How can I adjust the CSS processing to allow me to skip processing these URLs by using the css-loader url config? https://webpack.js.org/loaders/css-loader/#url

0 Replies