mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-06-13 00:28:34 +08:00
Better React Native Web support (#2511)
* Better React Native Web support * Adding better react-native-web support for jest testing
This commit is contained in:
@@ -94,7 +94,9 @@ module.exports = {
|
||||
// We also include JSX as a common component filename extension to support
|
||||
// some tools, although we do not recommend using it, see:
|
||||
// https://github.com/facebookincubator/create-react-app/issues/290
|
||||
extensions: ['.js', '.json', '.jsx'],
|
||||
// `web` extension prefixes have been added for better support
|
||||
// for React Native Web.
|
||||
extensions: ['.web.js', '.js', '.json', '.web.jsx', '.jsx'],
|
||||
alias: {
|
||||
// @remove-on-eject-begin
|
||||
// Resolve Babel runtime relative to react-scripts.
|
||||
|
||||
@@ -94,7 +94,9 @@ module.exports = {
|
||||
// We also include JSX as a common component filename extension to support
|
||||
// some tools, although we do not recommend using it, see:
|
||||
// https://github.com/facebookincubator/create-react-app/issues/290
|
||||
extensions: ['.js', '.json', '.jsx'],
|
||||
// `web` extension prefixes have been added for better support
|
||||
// for React Native Web.
|
||||
extensions: ['.web.js', '.js', '.json', '.web.jsx', '.jsx'],
|
||||
alias: {
|
||||
// @remove-on-eject-begin
|
||||
// Resolve Babel runtime relative to react-scripts.
|
||||
|
||||
@@ -43,6 +43,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
|
||||
moduleNameMapper: {
|
||||
'^react-native$': 'react-native-web',
|
||||
},
|
||||
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx'],
|
||||
};
|
||||
if (rootDir) {
|
||||
config.rootDir = rootDir;
|
||||
|
||||
Reference in New Issue
Block a user