From 75fa67e14d567b5983f3ac68ad05e4c9b8779eee Mon Sep 17 00:00:00 2001 From: James Ide Date: Mon, 19 Jun 2017 10:44:46 -0700 Subject: [PATCH] Add the blacklist creation function to the list of exports Summary: We use a custom rn-cli.config.js file that specifies a custom blacklist. In addition to blacklisting some of our own directories, we still want to keep RN's default rules for what to blacklist so we also call into the packager's blacklist. Closes https://github.com/facebook/metro-bundler/pull/13 Differential Revision: D5275117 Pulled By: davidaurelio fbshipit-source-id: 0ad79fa47b8730af5a2c4e9ecbedf02b7d673b6c --- .../metro-bundler/src/__tests__/index-test.js | 17 +++++++++++++++++ packages/metro-bundler/src/index.js | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 packages/metro-bundler/src/__tests__/index-test.js diff --git a/packages/metro-bundler/src/__tests__/index-test.js b/packages/metro-bundler/src/__tests__/index-test.js new file mode 100644 index 00000000..3090fd0d --- /dev/null +++ b/packages/metro-bundler/src/__tests__/index-test.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @format + */ +'use strict'; + +const metro = require('..'); + +it('exports the blacklist creator', () => { + expect(metro.createBlacklist).toBeDefined(); +}); diff --git a/packages/metro-bundler/src/index.js b/packages/metro-bundler/src/index.js index f3671655..bf189aa6 100644 --- a/packages/metro-bundler/src/index.js +++ b/packages/metro-bundler/src/index.js @@ -14,6 +14,7 @@ const Logger = require('./Logger'); const TransformCaching = require('./lib/TransformCaching'); +const blacklist = require('./blacklist'); const debug = require('debug'); const invariant = require('fbjs/lib/invariant'); @@ -26,6 +27,7 @@ import type {TransformCache} from './lib/TransformCaching'; import type {Reporter} from './lib/reporting'; import type {HasteImpl} from './node-haste/Module'; +exports.createBlacklist = blacklist; exports.sourceMaps = {fromRawMappings, compactMapping}; exports.createServer = createServer; exports.Logger = Logger;