Allow direct references of doctor and pkg from the main bundle

Summary: This diff allows direct referencing pkg and doctor packages from the main bundle so they can be changed and used in the main app without publishing to npm

Reviewed By: mweststrate

Differential Revision: D20390416

fbshipit-source-id: af625a8b7cead4481743a88aec198493d363ce76
This commit is contained in:
Anton Nikolaev
2020-03-14 15:56:58 -07:00
committed by Facebook GitHub Bot
parent 10d990c32c
commit 952cb7783a
6 changed files with 33 additions and 22 deletions

View File

@@ -74,15 +74,15 @@ export function compile(buildFolder: string, entry: string) {
serializer: {},
transformer: {
babelTransformerPath: path.join(
__dirname,
'..',
projectRoot,
'static',
'transforms',
'index.js',
),
},
resolver: {
blacklistRE: /(\/|\\)(sonar|flipper|flipper-public)(\/|\\)(desktop)(\/|\\)(dist|doctor)(\/|\\)|(\.native\.js$)/,
resolverMainFields: ['flipper:source', 'module', 'main'],
blacklistRE: /\.native\.js$/,
},
},
{
@@ -118,8 +118,7 @@ export async function compileMain({dev}: {dev: boolean}) {
watchFolders: [projectRoot],
transformer: {
babelTransformerPath: path.join(
__dirname,
'..',
projectRoot,
'static',
'transforms',
'index.js',
@@ -127,7 +126,8 @@ export async function compileMain({dev}: {dev: boolean}) {
},
resolver: {
sourceExts: ['tsx', 'ts', 'js'],
blacklistRE: /(\/|\\)(sonar|flipper|flipper-public)(\/|\\)(desktop)(\/|\\)(dist|doctor)(\/|\\)|(\.native\.js$)/,
resolverMainFields: ['flipper:source', 'module', 'main'],
blacklistRE: /\.native\.js$/,
},
});
await Metro.runBuild(config, {