mirror of https://github.com/status-im/metro.git
Upgrade to node-haste@2.10.0 and allow to specify extra node modules
Summary: This upgrades to node-haste@2.10.0 and allows to expose folders as additional node modules from rn-cli.config.js Reviewed By: bestander Differential Revision: D3232595 fb-gh-sync-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59 fbshipit-source-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59
This commit is contained in:
parent
d4e704be17
commit
789978a9ec
|
@ -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,
|
||||
});
|
||||
|
||||
|
|
|
@ -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'],
|
||||
});
|
||||
|
||||
|
|
|
@ -45,7 +45,11 @@ const validateOpts = declareOpts({
|
|||
default: false,
|
||||
},
|
||||
transformModulePath: {
|
||||
type:'string',
|
||||
type: 'string',
|
||||
required: false,
|
||||
},
|
||||
extraNodeModules: {
|
||||
type: 'object',
|
||||
required: false,
|
||||
},
|
||||
nonPersistent: {
|
||||
|
|
Loading…
Reference in New Issue