mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: I am importing an image from a scoped package and I expected this to be recognized by the `module.name_mapper` and treated as a `RelativeImageStub`. But since there's an `@` in the path, the string does not match the regex pattern as it is defined today. Therefore I added the possibility of a `@` in the start of the path to the regex pattern. Example import not recognized by the name_mapper today: ``` import NicePicture from 'example-pkg/assets/nice-picture.png' ``` ## Changelog [General] [Fixed] - Make RelativeImageStub regex match images in scoped packages Pull Request resolved: https://github.com/facebook/react-native/pull/26567 Test Plan: * I have run `yarn flow` in the `react-native` project * I tested that it resolves my issue with images in scoped packages in my own app's repo Differential Revision: D17589473 Pulled By: cpojer fbshipit-source-id: d0c18f2b36456fd974012a0605f3d9ceff0ad744