Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

v1.0.1

Latest
Compare
Choose a tag to compare
@taylorbryant taylorbryant released this 08 Feb 15:36
· 8 commits to master since this release

Next.js + React Profiler

Enable the React Profiler during a production build in your Next.js project

Installation

npm install --save next-plugin-profiler

or

yarn add next-plugin-profiler

Usage with environment variables

Create a next.config.js:

// next.config.js
const withProfiler = require(`next-plugin-profiler`)({
  isEnabled: process.env.ENABLE_PROFILER === `true`
});

module.exports = withProfiler({});

Then you can run a build command with environment variable and the condition you've set:

ENABLE_PROFILER=true npm run build