You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Metro only supports module resolution for a single platform. I.e., you provide a single platform to Metro as an option, and Metro will return files and assets matching Foo.platform.js, Foo.native.js, and Foo.js.
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
N/A
What is the expected behavior?
There are some cases where we want to share code across platforms, and specialize where necessary. E.g., WPF and UWP (see react-native-windows).
Similarly, there may be cases where we want to share code across versions of a platform, but do not want to use conditional version checks inside the source code. E.g., Foo.androidm.js and Foo.androidn.js.
Lastly, there are cases where you're using a single native platform, but may want to customize the module resolution based on device family. E.g., Foo.ipad.js and Foo.iphone.js or Foo.xbox.js and Foo.hololens.js. Similarly, we may also want to support arbitrary sharing of code across native platforms with similar device families, e.g., Foo.mobile.js or Foo.desktop.js.
To do this, I'd like to have an option to resolve multiple platforms in preferential order. For example, rather than providing a single platform, e.g., 'ios', I may provide an ordered list of platforms, e.g., ['ipad', 'ios'] or ['uwp', 'windows'].
This could be implemented as an optional parameter to keep backward compatibility. We could also use such a feature to simplify the code paths for .native.js extensions (e.g., ['uwp', 'windows', 'native']).
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
N/A
The text was updated successfully, but these errors were encountered:
I'm currently trying to get react-native-web integrated. But it looks like that would require a different transform configuration, in which case metro should be running on a different port.
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Metro only supports module resolution for a single platform. I.e., you provide a single platform to Metro as an option, and Metro will return files and assets matching
Foo.platform.js
,Foo.native.js
, andFoo.js
.If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.N/A
What is the expected behavior?
Foo.androidm.js
andFoo.androidn.js
.Foo.ipad.js
andFoo.iphone.js
orFoo.xbox.js
andFoo.hololens.js
. Similarly, we may also want to support arbitrary sharing of code across native platforms with similar device families, e.g.,Foo.mobile.js
orFoo.desktop.js
.To do this, I'd like to have an option to resolve multiple platforms in preferential order. For example, rather than providing a single platform, e.g.,
'ios'
, I may provide an ordered list of platforms, e.g.,['ipad', 'ios']
or['uwp', 'windows']
.This could be implemented as an optional parameter to keep backward compatibility. We could also use such a feature to simplify the code paths for
.native.js
extensions (e.g.,['uwp', 'windows', 'native']
).Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
N/A
The text was updated successfully, but these errors were encountered: