Skip to content

Commit 073e2b7

Browse files
committed
docs: add information about TypeScript under aliasing
1 parent 1443536 commit 073e2b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ There are 2 parts to this process.
254254

255255
1. **Aliasing the JavaScript code**
256256

257-
The JavaScript (or TypeScript) source code is aliased to be used by the example app. This makes it so that when you import from `'your-library-name'`, it imports the source code directly and avoids having to rebuild the library for JavaScript only changes. This is achieved by using [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver) in the `example/babel.config.js` file.
258-
259-
In addition to the alias, we need also need to configure the bundler to handle it correctly.
257+
The JavaScript (or TypeScript) source code is aliased to be used by the example app. This makes it so that when you import from `'your-library-name'`, it imports the source code directly and avoids having to rebuild the library for JavaScript only changes. We configure several tools to make this work:
260258

259+
- [Babel](https://babeljs.io) is configured to use the alias in `example/babel.config.js` using [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver). This transforms the imports to point to the source code instead.
261260
- [Metro](https://facebook.github.io/metro/) is configured to allow importing from outside of the `example` directory by configuring `watchFolders`, and to use the appropriate peer dependencies. This configuration exists in the `example/metro.config.js` file.
262261
- [Webpack](https://webpack.js.org/) is configured to compile the library source code when running on the Web. This configuration exists in the `example/webpack.config.js` file.
262+
- [TypeScript](https://www.typescriptlang.org/) is configured to use the source code for type checking by using the `paths` property under `compilerOptions`. This configuration exists in the `tsconfig.json` file at the root.
263263

264264
2. **Linking the native code**
265265

0 commit comments

Comments
 (0)