Skip to content

Instantly share code, notes, and snippets.

@midanosi
Created November 27, 2023 13:14
Show Gist options
  • Select an option

  • Save midanosi/43382fa3af005b33f85a5028d5f49bc8 to your computer and use it in GitHub Desktop.

Select an option

Save midanosi/43382fa3af005b33f85a5028d5f49bc8 to your computer and use it in GitHub Desktop.

how to profile a built react app

  1. install react devtools
  2. then in vite.config.ts

const profiling = isProduction && {
  "react-dom/client": "react-dom/profiling",
};

config
resolve: {
    alias: {
      ...profiling,
    }
},
build: {
  minify: false,
},
  1. build and serve app
  2. use React DevTools Profiling tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment