NextJS: How to add nextJS config along withSass plugin?

Hi! To those who use NextJS I have a config file like this:

const withSass = require('@zeit/next-sass');

const nextJsConfig = {
  exportPathMap: function() {
    return {
      '/': { page: '/' }
    }
  }
}

module.exports = withSass({
  webpack(config, options) {
    options.exportPathMap = nextJsConfig.exportPathMap;
    return config;
  }
});

But the configurations doesn’t work. How do you add nextJS configurations to the withSass() plugin?

Thank you campers
:slight_smile:

I solved it! =))

const withSass = require('@zeit/next-sass');

const nextJsConfig = {
  exportPathMap: function() {
    return {
      '/': { page: '/' }
    }
  }
}

module.exports = withSass(nextJsConfig);
1 Like