mirror of
https://github.com/status-im/react-native.git
synced 2025-01-26 17:30:25 +00:00
535ee40818
Summary: *This is a PR to fix #1939 (DependencyResolver fails to handle ES6 modules import statements with new lines)* **This PR includes:** - A fix to the problematic regular expression - Updated tests that support the new line style. **Summary:** We found out that while the packager does its module wrapping thing for lines like this: ```js import theDefault, { named1, named2 } from 'src/mylib'; ``` It fails to do the same for multi line imports: ```js import theDefault, { named1, named2 } from 'src/mylib'; ``` We've tracked done the issue to a [faulty regular expression in replacePatterns.js](https://github.com/facebook/react-native/blob/master/packager/react-packager/src/DependencyResolver/replacePatterns.js#L12) You can see various import statements with the problematic regular expression [here](http://regexr.com/3bc8m) We've figure out a better regular expression (you can play around with it [here](http://regexr.com/3bd3s))Closes https://github.com/facebook/react-native/pull/1940 Reviewed By: @svcscm Differential Revision: D2498519 Pulled By: @vjeux