mirror of https://github.com/status-im/metro.git
c4307d7170
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 https://github.com/facebook/metro-bundler/pull/69 Differential Revision: D6008567 Pulled By: cpojer fbshipit-source-id: f9be328cf50dc47c7433ffeb5eb053b398c92122 |
||
---|---|---|
.. | ||
src | ||
.eslintrc | ||
.npmignore | ||
README.md | ||
package.json | ||
rn-babelrc.json | ||
yarn.lock |
README.md
metro-bundler
🚇 The JavaScript bundler for React Native.
- 🚅 Fast: We aim for sub-second reload cycles, fast startup and quick bundling speeds.
- ⚖️ Scalable: Works with thousands of modules in a single application.
- ⚛️ Integrated: Supports every React Native project out of the box.
This project was previously part of the react-native repository. In this smaller repository it is easier for the team working on Metro Bundler to respond to both issues and pull requests. See react-native#13976 for the initial announcement.