-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: parse TSX files for module detection, define NODE_ENV, polyfill …
…missing Node.js globals (netlify/edge-bundler#519) * fix: parse TSX files for module detection, define NODE_ENV * chore: remove comment * fix: only define `process.env.NODE_ENV` for builds * fix: implement polyfills for Node globals * fix: remove .only * refactor: use banner instead * fix: ensure customer code can't access process.env * fix: remove .only once again * chore: cleanup foo var * chore: align formatting * refactor: replace two bools with environment
- Loading branch information
Showing
10 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/edge-bundler/test/fixtures/tsx/functions/func1.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
|
||
export default () => { | ||
try { | ||
// this is expected to fail | ||
process.env.FOO | ||
} catch { | ||
return new Response(<p>Hello World</p>) | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/edge-bundler/test/fixtures/tsx/node_modules/react/cjs/react.development.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
packages/edge-bundler/test/fixtures/tsx/node_modules/react/cjs/react.production.min.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
packages/edge-bundler/test/fixtures/tsx/node_modules/react/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
packages/edge-bundler/test/fixtures/tsx/node_modules/react/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.