Derek DiStefano
Derek DiStefano

Reputation: 1

IE11 support react-id-swiper in Next.js

I'm using react-id-swiper in a project but IE11 breaks the app. I was reading that you need to transpile with webpack config but that doesn't work with Next.js webpack.

next.config.js

const webpack = require("webpack");
module.exports = {
  webpack: (config, { defaultLoaders }) => {
    config.module.rules.push({
      exclude: [/node_modules\/(?!(swiper|dom7)\/).*/, /\.test\.js(x)?$/],
      test: /\.js(x)?$/,
      use: defaultLoaders.babel
    });
    return config;
  }
};

Upvotes: 0

Views: 1133

Answers (1)

Scott L
Scott L

Reputation: 529

Had this same issue last week and next-transpile-modules saved me. Next won't transpile extra NPM packages. So frustrating but at least this exists.

https://github.com/martpie/next-transpile-modules

Upvotes: 1

Related Questions