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

About

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

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next.js + React Profiler

Update: You don't need this anymore. In v9.5, Next.js added a --profile flag to enable React Profiler in a production build.

npm badge

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 file:

// 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 the environment variable:

ENABLE_PROFILER=true npm run build

About

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

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages