next-intercept-stdout
v1.0.1
Published
[![next-intercept-stdout](https://img.shields.io/npm/v/next-intercept-stdout?style=for-the-badge)](https://www.npmjs.com/package/next-intercept-stdout)
Downloads
26,721
Readme
next-intercept-stdout
Next.js plugin to intercept stdout
Justification
- 💎 This module wraps
intercept-stdout
as the form of the Next.js plugin. - 🙋🏽 Why wrap this module?
- I didn't want to call a function separate from other
NextConfig
values and plugins. It makes the action look suspicious and less coupled. - In addition,
intercept-stdout
was last distributed about six years ago, so it seemed necessary to cover the implementation separately in case it no longer works.
- I didn't want to call a function separate from other
Ignore Duplicate atom key
warnings for Recoil
// next.config.js
const withInterceptStdout = require('next-intercept-stdout');
module.exports = withInterceptStdout(
{
reactStrictMode: true,
},
(text) => (text.includes('Duplicate atom key') ? '' : text),
);
Usage with the
NextConfig
Object
// next.config.js
const withInterceptStdout = require('next-intercept-stdout');
const withSvgr = require('@newhighsco/next-plugin-svgr');
module.exports = withInterceptStdout(
withSvgr({
reactStrictMode: true,
svgrOptions: {},
}),
(text) => (text.includes('Duplicate atom key') ? '' : text),
);
Usage with other Next.js plugins