next-intercept-stdout

1.0.1 • Public • Published

next-intercept-stdout

next-intercept-stdout

Next.js plugin to intercept stdout

Justification

  1. 💎 This module wraps intercept-stdout as the form of the Next.js plugin.
  2. 🙋🏽 Why wrap this module?
    1. I didn't want to call a function separate from other NextConfig values and plugins. It makes the action look suspicious and less coupled.
    2. 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.

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

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i next-intercept-stdout

    Weekly Downloads

    4,031

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    1.92 kB

    Total Files

    4

    Last publish

    Collaborators

    • junhoyeo