Skip to content

Commit c10e32a

Browse files
committed
Support .mjs
1 parent 94f19d3 commit c10e32a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The communication between React app and React Native app will be also simplified
2222
## Features
2323

2424
- Create React app bundle for WebView automatically in build process of React Native
25-
- `.js`, `.ts`, `.jsx`, `.tsx` will be packed into one source.
25+
- `.js`, `.ts`, `.jsx`, `.tsx` and `.mjs` will be packed into one source.
2626
- NOTE: Only the edits in the entry file of web will invoke rebuild because of the limitation of [metro](https://github.com/facebook/metro)'s build process.
2727
- Handle communication between React Native and WebView with React hook style
2828
- With `useBridge` hook, you can subscribe messages from WebView.

src/plugin/metro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Metro from "metro";
22

33
const babelTransformerPath = require.resolve("./transformer");
4-
const codeExts = ["js", "ts", "jsx", "tsx"];
4+
const codeExts = ["js", "ts", "jsx", "tsx", "mjs"];
55
const htmlExts = ["htm", "html", "css"];
66
const imageExts = ["bmp", "gif", "png", "jpg", "jpeg", "webp", "svg"];
77
const textExts = ["txt", "md"];

0 commit comments

Comments
 (0)