From 513432661af90f2002e5290475afb4c6554be5ac Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Wed, 12 Apr 2023 20:47:49 -0700 Subject: [PATCH] enable profiler for production --- electron-react/index.html | 2 +- electron-react/vite.config.ts | 10 +++++++++- electron-react/vite.legacy.config.ts | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/electron-react/index.html b/electron-react/index.html index e403878..f8c3678 100644 --- a/electron-react/index.html +++ b/electron-react/index.html @@ -5,7 +5,7 @@ - + Athena diff --git a/electron-react/vite.config.ts b/electron-react/vite.config.ts index d85b960..6ff7963 100644 --- a/electron-react/vite.config.ts +++ b/electron-react/vite.config.ts @@ -16,7 +16,15 @@ export default defineConfig(({ command }) => { return { resolve: { alias: { - '@': path.join(__dirname, 'src') + '@': path.join(__dirname, 'src'), + 'react-dom/client': path.resolve( + __dirname, + 'node_modules/react-dom/profiling.js' + ), + 'scheduler/tracing': path.resolve( + __dirname, + 'node_modules/scheduler/tracing-profiling' + ), }, }, plugins: [ diff --git a/electron-react/vite.legacy.config.ts b/electron-react/vite.legacy.config.ts index 506915b..1b6fc2b 100644 --- a/electron-react/vite.legacy.config.ts +++ b/electron-react/vite.legacy.config.ts @@ -19,7 +19,15 @@ export default defineConfig(({ command }) => { return { resolve: { alias: { - '@': path.join(__dirname, 'src') + '@': path.join(__dirname, 'src'), + 'react-dom/client': path.resolve( + __dirname, + 'node_modules/react-dom/profiling.js' + ), + 'scheduler/tracing': path.resolve( + __dirname, + 'node_modules/scheduler/tracing-profiling' + ), }, }, plugins: [