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
48cb144c2d
commit
888749220d
|
@ -340,6 +340,8 @@ class ResolutionRequest {
|
||||||
file = potentialModulePath + '.native.js';
|
file = potentialModulePath + '.native.js';
|
||||||
} else if (this._fastfs.fileExists(potentialModulePath + '.js')) {
|
} else if (this._fastfs.fileExists(potentialModulePath + '.js')) {
|
||||||
file = potentialModulePath + '.js';
|
file = potentialModulePath + '.js';
|
||||||
|
} else if (this._fastfs.fileExists(potentialModulePath + '.jsx')) {
|
||||||
|
file = potentialModulePath + '.jsx';
|
||||||
} else if (this._fastfs.fileExists(potentialModulePath + '.json')) {
|
} else if (this._fastfs.fileExists(potentialModulePath + '.json')) {
|
||||||
file = potentialModulePath + '.json';
|
file = potentialModulePath + '.json';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,7 +55,7 @@ class DependencyGraph {
|
||||||
platforms: platforms || [],
|
platforms: platforms || [],
|
||||||
preferNativePlatform: preferNativePlatform || false,
|
preferNativePlatform: preferNativePlatform || false,
|
||||||
cache,
|
cache,
|
||||||
extensions: extensions || ['js', 'json'],
|
extensions: extensions || ['js', 'jsx', 'json'],
|
||||||
mocksPattern,
|
mocksPattern,
|
||||||
extractRequires,
|
extractRequires,
|
||||||
shouldThrowOnUnresolvedErrors,
|
shouldThrowOnUnresolvedErrors,
|
||||||
|
|
|
@ -151,6 +151,7 @@ class Server {
|
||||||
dir: dir,
|
dir: dir,
|
||||||
globs: [
|
globs: [
|
||||||
'**/*.js',
|
'**/*.js',
|
||||||
|
'**/*.jsx',
|
||||||
'**/*.json',
|
'**/*.json',
|
||||||
].concat(assetGlobs),
|
].concat(assetGlobs),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue