mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
7ebcc5bec9
* Allow deadCodeElemination when using process.browser * Add process.browser test
13 lines
262 B
JavaScript
13 lines
262 B
JavaScript
|
|
if (process.browser) {
|
|
global.__THIS_SHOULD_ONLY_BE_DEFINED_IN_BROWSER_CONTEXT__ = true
|
|
}
|
|
|
|
if (!process.browser) {
|
|
global.__THIS_SHOULD_ONLY_BE_DEFINED_IN_SERVER_CONTEXT__ = true
|
|
}
|
|
|
|
export default () => (
|
|
<div id='node-env'>{process.env.NODE_ENV}</div>
|
|
)
|