bugfix(react-native): fix buildable react native library (#11368)
- fix the issue where it only product type file
This commit is contained in:
parent
13b0d8c75d
commit
6c4fd2f5da
@ -1,3 +1,11 @@
|
|||||||
{
|
{
|
||||||
"presets": ["module:metro-react-native-babel-preset"]
|
"presets": [
|
||||||
|
[
|
||||||
|
"@nrwl/react/babel",
|
||||||
|
{
|
||||||
|
"runtime": "automatic",
|
||||||
|
"useBuiltIns": "usage"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
||||||
"types": ["node"]
|
"types": ["node"],
|
||||||
|
"jsx": "react-native"
|
||||||
},
|
},
|
||||||
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "test-setup.ts"],
|
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "test-setup.ts"],
|
||||||
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
|
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
|
||||||
|
|||||||
@ -273,7 +273,7 @@ describe('lib', () => {
|
|||||||
executor: '@nrwl/web:rollup',
|
executor: '@nrwl/web:rollup',
|
||||||
outputs: ['{options.outputPath}'],
|
outputs: ['{options.outputPath}'],
|
||||||
options: {
|
options: {
|
||||||
external: ['react/jsx-runtime'],
|
external: ['react/jsx-runtime', 'react-native'],
|
||||||
entryFile: 'libs/my-lib/src/index.ts',
|
entryFile: 'libs/my-lib/src/index.ts',
|
||||||
outputPath: 'dist/libs/my-lib',
|
outputPath: 'dist/libs/my-lib',
|
||||||
project: 'libs/my-lib/package.json',
|
project: 'libs/my-lib/package.json',
|
||||||
|
|||||||
@ -81,7 +81,7 @@ function addProject(host: Tree, options: NormalizedSchema) {
|
|||||||
|
|
||||||
if (options.publishable || options.buildable) {
|
if (options.publishable || options.buildable) {
|
||||||
const { libsDir } = getWorkspaceLayout(host);
|
const { libsDir } = getWorkspaceLayout(host);
|
||||||
const external = ['react/jsx-runtime'];
|
const external = ['react/jsx-runtime', 'react-native'];
|
||||||
|
|
||||||
targets.build = {
|
targets.build = {
|
||||||
executor: '@nrwl/web:rollup',
|
executor: '@nrwl/web:rollup',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user