Skip to content

Commit c0b6a25

Browse files
committed
fix: update readme for esbuild options
1 parent bd1c860 commit c0b6a25

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,23 @@ module.exports = (async () => {
146146
})();
147147
```
148148

149+
#### Custom Esbuild options
150+
To support custom Esbuild options, we can use Multiple Transformers method and replace the customTransformer.js file with the following code:
151+
152+
```
153+
// root/customTransformer.js
154+
const reactNativeReactBridgeTransformer = require("react-native-react-bridge/lib/plugin");
155+
156+
module.exports.transform = function ({ src, filename, options }) {
157+
const esbuildOptions = {
158+
pluglins: [
159+
],
160+
};
161+
const transform = reactNativeReactBridgeTransformer.createTransformer(esbuildOptions);
162+
return transform({ src, filename, options });
163+
};
164+
```
165+
149166
### 2. Make entry file for web app.
150167

151168
- If you use React, React Native Web or Preact with React alias, import modules `react-native-react-bridge/lib/web`.

0 commit comments

Comments
 (0)