Numerous Pulsating Martians

    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

    Keywords

    none

    Install

    npm i next-intercept-stdout

    DownloadsWeekly Downloads

    1,983

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    1.92 kB

    Total Files

    4

    Last publish

    Collaborators

    • junhoyeo