diff --git a/src/utils/compile.ts b/src/utils/compile.ts index 7e0326087..f48134c42 100644 --- a/src/utils/compile.ts +++ b/src/utils/compile.ts @@ -40,11 +40,11 @@ export default async function compile({ files.map(async (filepath) => { const outputFilename = path .join(output, path.relative(source, filepath)) - .replace(/\.(js|tsx?)$/, '.js'); + .replace(/\.(jsx?|tsx?)$/, '.js'); await fs.mkdirp(path.dirname(outputFilename)); - if (!/\.(js|tsx?)$/.test(filepath)) { + if (!/\.(jsx?|tsx?)$/.test(filepath)) { // Copy files which aren't source code fs.copy(filepath, outputFilename); return; diff --git a/templates/expo-library/example/webpack.config.js b/templates/expo-library/example/webpack.config.js index 68375c60a..902a095b9 100644 --- a/templates/expo-library/example/webpack.config.js +++ b/templates/expo-library/example/webpack.config.js @@ -9,7 +9,7 @@ module.exports = async function (env, argv) { const config = await createExpoWebpackConfigAsync(env, argv); config.module.rules.push({ - test: /\.(js|ts|tsx)$/, + test: /\.(js|jsx|ts|tsx)$/, include: path.resolve(root, 'src'), use: 'babel-loader', });