IE11在Next.js中支持react-id-swiper

时间:2019-09-25 16:28:29

标签: swiper

我在项目中使用react-id-swiper,但IE11中断了该应用程序。我读到您需要使用webpack配置进行转换,但这不适用于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;
  }
};

1 个答案:

答案 0 :(得分:0)

上周发生了同样的问题,next-transpile-modules救了我。下一步将不会传输额外的NPM软件包。很令人沮丧,但至少存在。

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