Skip to content

Commit f2da5e4

Browse files
committed
Fix __DEV__ not being replaced in development bundle
1 parent b15ee43 commit f2da5e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
],
1818
"scripts": {
1919
"prepublishOnly": "run-s build",
20-
"build:prod": "microbundle --target node -f cjs --compress --globals '__DEV__=false' -o dist/react-ssr-prepass.production.min.js",
21-
"build:dev": "microbundle --target node -f cjs --no-compress --globals '__DEV__=true' -o dist/react-ssr-prepass.development.js",
20+
"build:prod": "microbundle --target node -f cjs --compress --define '__DEV__=false' -o dist/react-ssr-prepass.production.min.js",
21+
"build:dev": "microbundle --target node -f cjs --no-compress --define '__DEV__=true' -o dist/react-ssr-prepass.development.js",
2222
"build": "run-p build:prod build:dev",
2323
"test": "jest",
2424
"flow": "flow"

src/visitor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import {
6060

6161
// Time in ms after which the otherwise synchronous visitor yields so that
6262
// the event loop is not interrupted for too long
63-
const YIELD_AFTER_MS = __DEV__ ? 20 : 5
63+
const YIELD_AFTER_MS = process.env.NODE_ENV !== 'production' ? 20 : 5
6464

6565
const render = (
6666
type: ComponentType<DefaultProps> & ComponentStatics,

0 commit comments

Comments
 (0)