Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent error on safely-handled requires using non-static arguments
Summary: **Summary** This is the workaround that cpojer suggested in #65 and should resolve the biggest pain point that developers are experiencing in that issue: using moment.js in React Native. Hopefully this at least serves as a starting point to reaching a decent solution for libraries using non-static `require()` statements. **Test plan** - Expected error when non-static-argument-based `require()` is nested more than one level deep within a `try` statement - Expected no error when non-static-argument-based `require()` is nested directly within a `try` statement ```bash ip-192-168-1-10:trueflipapp richard$ react-native bundle --entry-file index.js --platform ios --bundle-output /tmp/test.js --reset-cache Scanning folders for symlinks in /repo/trueflip/sandbox/code/trueflipapp/node_modules (8ms) Scanning folders for symlinks in /repo/trueflip/sandbox/code/trueflipapp/node_modules (8ms) Loading dependency graph, done. warning: the transform cache was reset. bundle: start bundle: finish bundle: Writing bundle output to: /tmp/test.js bundle: Done writing bundle output ``` Closes #69 Differential Revision: D6008567 Pulled By: cpojer fbshipit-source-id: f9be328cf50dc47c7433ffeb5eb053b398c92122
- Loading branch information