bugfix(react-native): fix buildable react native library (#11368)

- fix the issue where it only product type file
This commit is contained in:
Emily Xiong 2022-08-02 15:20:08 -04:00 committed by GitHub
parent 13b0d8c75d
commit 6c4fd2f5da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,11 @@
{
"presets": ["module:metro-react-native-babel-preset"]
"presets": [
[
"@nrwl/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
]
}

View File

@ -2,7 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
"types": ["node"]
"types": ["node"],
"jsx": "react-native"
},
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "test-setup.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]

View File

@ -273,7 +273,7 @@ describe('lib', () => {
executor: '@nrwl/web:rollup',
outputs: ['{options.outputPath}'],
options: {
external: ['react/jsx-runtime'],
external: ['react/jsx-runtime', 'react-native'],
entryFile: 'libs/my-lib/src/index.ts',
outputPath: 'dist/libs/my-lib',
project: 'libs/my-lib/package.json',

View File

@ -81,7 +81,7 @@ function addProject(host: Tree, options: NormalizedSchema) {
if (options.publishable || options.buildable) {
const { libsDir } = getWorkspaceLayout(host);
const external = ['react/jsx-runtime'];
const external = ['react/jsx-runtime', 'react-native'];
targets.build = {
executor: '@nrwl/web:rollup',