Open Jeremboo opened 8 months ago
:wave: Can confirm this is still an issue. I was able to work around it by wrapping the require in a CJS file:
// prevalWrapper.cjs
const createNextPluginPreval = require('next-plugin-preval/config');
const withNextPluginPreval = createNextPluginPreval();
module.exports = withNextPluginPreval;
Then importing the wrapper:
// next.config.mjs
import withNextPluginPreval from './prevalWrapper.cjs';
const nextConfig = { /* options */ };
export default withNextPluginPreval(nextConfig);
Hi,
My project is setup with a
next.config.mjs
which use the ES module system instead of CommomJS.And the project doesn't look to work with ES6:
import createNextPluginPreval from 'next-plugin-preval'
looks to exists but is just a[Function (anonymous)]
who does nothing.Maybe should you just place the
config.js
into thedist/
folder ? I can do a PR if you want.