cyrilwanner / next-compose-plugins

💡next-compose-plugins provides a cleaner API for enabling and configuring plugins for next.js
MIT License
736 stars 12 forks source link

next configuration with recoil for IE 11 #54

Open ghost opened 2 years ago

ghost commented 2 years ago

I'm thinking about that I use recoil on my project..

But we have to support IE 11, but my configuration is not working in IE 11.

This is error message on IE 11. -- "Error was not caught SyntaxError"

So here is the below code.

// .babelrc
{
  "presets": ["next/babel"],
  "plugins": ["emotion"]
}
// next.config.js
const withPlugins = require('next-compose-plugins');
const withImages = require('next-images');
const withTM = require('next-transpile-modules')(['recoil'], { debug: true });

const nextConfig = {
  webpack: (config, options) => {
    return config;
  },
  publicRuntimeConfig: {
    ...environmentConfig
  }
}

const plugins = [
  withTM(nextConfig),
  [ withImages() ]
];

module.exports = withPlugins([...plugins]);

Could you help me?