mirror of https://github.com/status-im/metro.git
Enable JSX files extension
Summary: JSX extension is much used in React, this would be a natural addition for React Native. See: https://github.com/facebook/react-native/issues/2303 Closes https://github.com/facebook/react-native/pull/5233 Reviewed By: svcscm Differential Revision: D2818888 Pulled By: mkonicek fb-gh-sync-id: 856d1b8ba9ff88ba08a00923174e3284f359d774
This commit is contained in:
parent
0001c20760
commit
e35b8f1724
|
@ -340,6 +340,8 @@ class ResolutionRequest {
|
|||
file = potentialModulePath + '.native.js';
|
||||
} else if (this._fastfs.fileExists(potentialModulePath + '.js')) {
|
||||
file = potentialModulePath + '.js';
|
||||
} else if (this._fastfs.fileExists(potentialModulePath + '.jsx')) {
|
||||
file = potentialModulePath + '.jsx';
|
||||
} else if (this._fastfs.fileExists(potentialModulePath + '.json')) {
|
||||
file = potentialModulePath + '.json';
|
||||
} else {
|
||||
|
|
|
@ -55,7 +55,7 @@ class DependencyGraph {
|
|||
platforms: platforms || [],
|
||||
preferNativePlatform: preferNativePlatform || false,
|
||||
cache,
|
||||
extensions: extensions || ['js', 'json'],
|
||||
extensions: extensions || ['js', 'jsx', 'json'],
|
||||
mocksPattern,
|
||||
extractRequires,
|
||||
shouldThrowOnUnresolvedErrors,
|
||||
|
|
|
@ -151,6 +151,7 @@ class Server {
|
|||
dir: dir,
|
||||
globs: [
|
||||
'**/*.js',
|
||||
'**/*.jsx',
|
||||
'**/*.json',
|
||||
].concat(assetGlobs),
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue