diff --git a/react-packager/src/Bundler/index.js b/react-packager/src/Bundler/index.js index a6041e40..c718bb40 100644 --- a/react-packager/src/Bundler/index.js +++ b/react-packager/src/Bundler/index.js @@ -57,6 +57,10 @@ const validateOpts = declareOpts({ type:'string', required: false, }, + extraNodeModules: { + type: 'object', + required: false, + }, nonPersistent: { type: 'boolean', default: false, @@ -141,6 +145,7 @@ class Bundler { transformCode: (module, code, options) => this._transformer.transformFile(module.path, code, options), + extraNodeModules: opts.extraNodeModules, minifyCode: this._transformer.minify, }); diff --git a/react-packager/src/Resolver/index.js b/react-packager/src/Resolver/index.js index f508c9b6..f2cad3e6 100644 --- a/react-packager/src/Resolver/index.js +++ b/react-packager/src/Resolver/index.js @@ -54,6 +54,10 @@ const validateOpts = declareOpts({ transformCode: { type: 'function', }, + extraNodeModules: { + type: 'object', + required: false, + }, minifyCode: { type: 'function', }, @@ -107,6 +111,7 @@ class Resolver { cache: opts.cache, shouldThrowOnUnresolvedErrors: (_, platform) => platform === 'ios', transformCode: opts.transformCode, + extraNodeModules: opts.extraNodeModules, assetDependencies: ['react-native/Libraries/Image/AssetRegistry'], }); diff --git a/react-packager/src/Server/index.js b/react-packager/src/Server/index.js index 1856fc96..608919b7 100644 --- a/react-packager/src/Server/index.js +++ b/react-packager/src/Server/index.js @@ -45,7 +45,11 @@ const validateOpts = declareOpts({ default: false, }, transformModulePath: { - type:'string', + type: 'string', + required: false, + }, + extraNodeModules: { + type: 'object', required: false, }, nonPersistent: {