Skip to content

Commit

Permalink
Enable JSX files extension
Browse files Browse the repository at this point in the history
Summary:
JSX extension is much used in React, this would be a natural addition for React Native.
See: facebook#2303
Closes facebook#5233

Reviewed By: svcscm

Differential Revision: D2818888

Pulled By: mkonicek

fb-gh-sync-id: 856d1b8ba9ff88ba08a00923174e3284f359d774
  • Loading branch information
kdemoya authored and christopherdro committed Jan 20, 2016
1 parent da3454a commit dab6f32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Expand Up @@ -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 {
Expand Down
Expand Up @@ -55,7 +55,7 @@ class DependencyGraph {
platforms: platforms || [],
preferNativePlatform: preferNativePlatform || false,
cache,
extensions: extensions || ['js', 'json'],
extensions: extensions || ['js', 'jsx', 'json'],
mocksPattern,
extractRequires,
shouldThrowOnUnresolvedErrors,
Expand Down
1 change: 1 addition & 0 deletions packager/react-packager/src/Server/index.js
Expand Up @@ -151,6 +151,7 @@ class Server {
dir: dir,
globs: [
'**/*.js',
'**/*.jsx',
'**/*.json',
].concat(assetGlobs),
};
Expand Down

0 comments on commit dab6f32

Please sign in to comment.