Open rozele opened 6 years ago
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.
I'm also currently trying to achieve above proposed bundle resolution for custom platforms. Anyone found a solution or a workaround?
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