twopluszero / next-images

Import images in Next.js (supports jpg, jpeg, svg, png and gif images)
MIT License
948 stars 67 forks source link

You are using withImages as an option for configuring withSass plugin. They are two separate plugins. You should call use them this way: #48

Closed weeeziyuanli closed 3 years ago

weeeziyuanli commented 4 years ago

I use bottom config, but no work

const withSass = require('@zeit/next-sass');
const withImages = require('next-images');
module.exports = withImages(
  withSass({
    sassLoaderOptions: {
      includePaths: ['./styles/']
    },
    cssModules: true,
    cssLoaderOptions: {
      importLoaders: 1,
      localIdentName: '[local]___[hash:base64:5]'
    }
  })
);

scss文件中

background: url(/static/images/header_bg@2x.jpg) top center;

Originally posted by @arefaslani in https://github.com/twopluszero/next-images/issues/10#issuecomment-426269041

arefaslani commented 3 years ago

@weeeziyuanli Please also try this package to compose plugins: https://www.npmjs.com/package/next-compose-plugins