Use helpers to check environment in frontend (#27633)
This commit is contained in:
parent
7ef56d6e50
commit
277e6968f5
8 changed files with 28 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue