mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): set up framework injector profile exclusively in browser environment (#55530)
This commit modifies the setup of the injector profiler to occur solely when the application is running in a browser context. This adjustment is made because the injector profile serves no purpose when the application is running on the server. PR Close #55530
This commit is contained in:
committed by
Andrew Kushnir
parent
9cd633e1b8
commit
3ee861835a
@@ -71,7 +71,11 @@ export function publishDefaultGlobalUtils() {
|
||||
if (!_published) {
|
||||
_published = true;
|
||||
|
||||
setupFrameworkInjectorProfiler();
|
||||
if (typeof window !== 'undefined') {
|
||||
// Only configure the injector profiler when running in the browser.
|
||||
setupFrameworkInjectorProfiler();
|
||||
}
|
||||
|
||||
for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {
|
||||
publishGlobalUtil(methodName as GlobalUtilsFunctions, method);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user