Skip to content

Commit 668d734

Browse files
authored
fix: add support for 'jsx' file extention (#109)
Co-authored-by: Olivier SECRET <[email protected]>
1 parent 8782a2b commit 668d734

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/utils/compile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export default async function compile({
4040
files.map(async (filepath) => {
4141
const outputFilename = path
4242
.join(output, path.relative(source, filepath))
43-
.replace(/\.(js|tsx?)$/, '.js');
43+
.replace(/\.(jsx?|tsx?)$/, '.js');
4444

4545
await fs.mkdirp(path.dirname(outputFilename));
4646

47-
if (!/\.(js|tsx?)$/.test(filepath)) {
47+
if (!/\.(jsx?|tsx?)$/.test(filepath)) {
4848
// Copy files which aren't source code
4949
fs.copy(filepath, outputFilename);
5050
return;

templates/expo-library/example/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = async function (env, argv) {
99
const config = await createExpoWebpackConfigAsync(env, argv);
1010

1111
config.module.rules.push({
12-
test: /\.(js|ts|tsx)$/,
12+
test: /\.(js|jsx|ts|tsx)$/,
1313
include: path.resolve(root, 'src'),
1414
use: 'babel-loader',
1515
});

0 commit comments

Comments
 (0)