Use helpers to check environment in frontend (#27633)
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
|
||||
import * as marky from 'marky';
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
import { isDevelopment } from './utils/environment';
|
||||
|
||||
if (isDevelopment()) {
|
||||
if (typeof performance !== 'undefined' && performance.setResourceTimingBufferSize) {
|
||||
// Increase Firefox's performance entry limit; otherwise it's capped to 150.
|
||||
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331135
|
||||
@@ -18,13 +20,13 @@ if (process.env.NODE_ENV === 'development') {
|
||||
}
|
||||
|
||||
export function start(name) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (isDevelopment()) {
|
||||
marky.mark(name);
|
||||
}
|
||||
}
|
||||
|
||||
export function stop(name) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (isDevelopment()) {
|
||||
marky.stop(name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user