always enable marks in development

This commit is contained in:
Nolan Lawson 2018-01-31 08:40:37 -08:00
parent 2c2f84b870
commit eebadf8a71
1 changed files with 3 additions and 2 deletions

View File

@ -1,8 +1,9 @@
import { mark as markyMark, stop as markyStop } from 'marky'
import noop from 'lodash/noop'
const enableMarks = typeof window !== 'undefined' &&
new URLSearchParams(location.search).get('marks') === 'true'
const enableMarks = process.browser &&
(process.env.NODE_ENV !== 'production' ||
new URLSearchParams(location.search).get('marks') === 'true')
const mark = enableMarks ? markyMark : noop
const stop = enableMarks ? markyStop : noop