You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`main`: The entry point for the commonjs build. This is used by Node - such as tests, SSR etc.
90
89
-`module`: The entry point for the ES module build. This is used by bundlers such as webpack.
91
-
-`react-native`: The entry point for the React Native apps. This is used by Metro. It's common to point to the source code here as it can make debugging easier.
92
90
-`types`: The entry point for the TypeScript definitions. This is used by TypeScript to type check the code using your library.
93
91
-`source`: The path to the source code. It is used by `react-native-builder-bob` to detect the correct output files and provide better error messages.
94
92
-`files`: The files to include in the package when publishing with `npm`.
Copy file name to clipboardExpand all lines: packages/react-native-builder-bob/src/index.ts
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -148,11 +148,10 @@ yargs
148
148
: undefined;
149
149
150
150
constentries: {[key: string]: string}={
151
-
'main': target
151
+
main: target
152
152
? path.join(output,target,'index.js')
153
153
: path.join(source,entryFile),
154
-
'react-native': path.join(source,entryFile),
155
-
'source': path.join(source,entryFile),
154
+
source: path.join(source,entryFile),
156
155
};
157
156
158
157
if(targets.includes('module')){
@@ -232,6 +231,23 @@ yargs
232
231
}
233
232
}
234
233
234
+
if(
235
+
pkg['react-native']&&
236
+
(pkg['react-native'].startsWith(source)||
237
+
pkg['react-native'].startsWith(`./${source}`))
238
+
){
239
+
const{ remove }=awaitprompts({
240
+
type: 'confirm',
241
+
name: 'remove',
242
+
message: `Your package.json has the 'react-native' field pointing to source code.\n This can cause problems when customizing babel configuration.\n Do you want to remove it?`,
0 commit comments