From 328d8ddb4781dc270d065aa45033b6be565b2c8f Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Tue, 6 Jun 2017 05:08:27 -0700 Subject: [PATCH] metro-bundler: make internal tool to use the new source of thruth for packager/metro-bundler Reviewed By: davidaurelio Differential Revision: D5182904 fbshipit-source-id: df5de3a9eb85560a09789d0a94eccb5c48ecba7b --- jest/preprocessor.js | 4 ++-- local-cli/dependencies/dependencies.js | 1 - local-cli/server/util/attachHMRServer.js | 2 -- setupBabel.js | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/jest/preprocessor.js b/jest/preprocessor.js index af38b1a73..74a574016 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -11,7 +11,7 @@ 'use strict'; const babel = require('babel-core'); -const babelRegisterOnly = require('../packager/src/babelRegisterOnly'); +const babelRegisterOnly = require('metro-bundler/build/babelRegisterOnly'); const createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction'); const path = require('path'); @@ -23,7 +23,7 @@ const nodeOptions = babelRegisterOnly.config([nodeFiles]); babelRegisterOnly([]); // has to be required after setting up babelRegisterOnly -const transformer = require('../packager/src/transformer.js'); +const transformer = require('metro-bundler/build/transformer.js'); module.exports = { process(src/*: string*/, file/*: string*/) { diff --git a/local-cli/dependencies/dependencies.js b/local-cli/dependencies/dependencies.js index e7c07fd94..5c47721f2 100644 --- a/local-cli/dependencies/dependencies.js +++ b/local-cli/dependencies/dependencies.js @@ -8,7 +8,6 @@ */ 'use strict'; -require('../../setupBabel')(); const ReactPackager = require('metro-bundler'); const denodeify = require('denodeify'); diff --git a/local-cli/server/util/attachHMRServer.js b/local-cli/server/util/attachHMRServer.js index e27b3c182..da80fcdef 100644 --- a/local-cli/server/util/attachHMRServer.js +++ b/local-cli/server/util/attachHMRServer.js @@ -15,8 +15,6 @@ const getInverseDependencies = require('./getInverseDependencies'); const querystring = require('querystring'); const url = require('url'); -import type Server from '../../../packager/src/Server'; -import type Module from '../../../packager/src/node-haste/Module'; import type {ResolutionResponse} from './getInverseDependencies'; import type {Server as HTTPServer} from 'http'; diff --git a/setupBabel.js b/setupBabel.js index 23741c5ea..ed3ff5bc5 100644 --- a/setupBabel.js +++ b/setupBabel.js @@ -9,7 +9,7 @@ 'use strict'; -const babelRegisterOnly = require('./packager/src/babelRegisterOnly'); +const babelRegisterOnly = require('metro-bundler/build/babelRegisterOnly'); const escapeRegExp = require('lodash/escapeRegExp'); const path = require('path');