Skip to content

Commit

Permalink
Apply workaround for importing images via css cyrilwanner#135 (cyrilw…
Browse files Browse the repository at this point in the history
  • Loading branch information
aantthony committed Apr 1, 2020
1 parent 7fb69c0 commit 39bbca3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/loaders/img-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ const applyImgLoader = (

webpackConfig.module.rules.push({
test: getHandledFilesRegex(handledImageTypes),
issuer: {
// Next.js already handles url() in css/sass/scss files
test: /\.\w+(?<!(s?c|sa)ss)$/i,
},
oneOf: [
// add all resource queries
...getResourceQueries(nextConfig, isServer, optimize ? 'img-loader' : null, imgLoaderOptions, detectedLoaders),
Expand Down

0 comments on commit 39bbca3

Please sign in to comment.