diff --git a/packages/metro/package.json b/packages/metro/package.json index dcbadaab..3ed2e9be 100644 --- a/packages/metro/package.json +++ b/packages/metro/package.json @@ -49,7 +49,6 @@ "babel-core": "^6.24.1", "babel-generator": "^6.26.0", "babel-plugin-external-helpers": "^6.22.0", - "babel-plugin-react-transform": "^3.0.0", "babel-plugin-transform-flow-strip-types": "^6.21.0", "babel-preset-es2015-node": "^6.1.1", "babel-preset-fbjs": "^2.1.4", @@ -76,6 +75,7 @@ "left-pad": "^1.1.3", "lodash.throttle": "^4.1.1", "merge-stream": "^1.0.1", + "metro-babel7-plugin-react-transform": "0.30.2", "metro-babylon7": "0.31.0", "metro-cache": "0.31.0", "metro-core": "0.31.0", diff --git a/packages/metro/src/babel-bridge.js b/packages/metro/src/babel-bridge.js index 52a441c8..3021d337 100644 --- a/packages/metro/src/babel-bridge.js +++ b/packages/metro/src/babel-bridge.js @@ -132,7 +132,7 @@ function makeMakeHMRConfig7() { return { plugins: [ [ - require('babel-plugin-react-transform').default, + require('metro-babel7-plugin-react-transform').default, { transforms: [ { diff --git a/packages/metro/src/legacy.js b/packages/metro/src/legacy.js index 01847662..1b74cee0 100644 --- a/packages/metro/src/legacy.js +++ b/packages/metro/src/legacy.js @@ -16,6 +16,7 @@ const blacklist = require('./blacklist'); const debug = require('debug'); const invariant = require('fbjs/lib/invariant'); +const {makeHMRConfig} = require('./babel-bridge'); const {Logger} = require('metro-core'); const {fromRawMappings, toSegmentTuple} = require('metro-source-map'); @@ -28,6 +29,7 @@ exports.createBlacklist = blacklist; exports.sourceMaps = {fromRawMappings, compactMapping: toSegmentTuple}; exports.createServer = createServer; exports.Logger = Logger; +exports.makeHMRConfig = makeHMRConfig; export type ConfigT = MetroConfig; type Options = {|