Skip to content

Commit 8e1eb00

Browse files
docs(example): provide __DEV__ replacement (#369)
1 parent 9007fe0 commit 8e1eb00

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

examples/js/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<div id="autocomplete"></div>
1414
</div>
1515

16+
<script src="index.ts"></script>
1617
<script src="app.ts"></script>
1718
</body>
1819
</html>

examples/js/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Parcel picks the `source` field of the monorepo packages and thus doesn't
2+
// apply the Babel config to replace our `__DEV__` global expression.
3+
// We therefore need to manually override it in the example app.
4+
// See https://twitter.com/devongovett/status/1134231234605830144
5+
(global as any).__DEV__ = process.env.NODE_ENV !== 'production';

0 commit comments

Comments
 (0)