Last active
September 26, 2019 04:38
-
-
Save DSchau/f1a407f1ec3da036e1194065d84ecaec to your computer and use it in GitHub Desktop.
React Profiler for Gatsby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HAVE NOT TESTED, BUYER BEWARE | |
/* | |
* Potential enhancements: | |
* disable mangling to see component names | |
* only do this with a certain env variable (e.g. PROFILE=true)? | |
*/ | |
exports.onCreateWebpackConfig = ({ | |
actions, | |
}) => { | |
actions.setWebpackConfig({ | |
resolve: { | |
alias: { | |
'react-dom$': 'react-dom/profiling', | |
'scheduler/tracing': 'scheduler/tracing-profiling', | |
} | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment