From 9a4e4e8ee8dc05341878f97c3b1735c6bf2757b9 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Fri, 13 Jan 2017 09:23:45 -0800 Subject: [PATCH] Fix packager breakages on node4 Summary: This fixes issues that only surface when running with node4 / npm2. Closes https://github.com/facebook/react-native/pull/11888 Differential Revision: D4415021 Pulled By: bestander fbshipit-source-id: 8672cd892c9dae41cc7b5b7b3227eb24dd780d22 --- packager/react-packager/react-packager.js | 2 +- packager/react-packager/src/JSTransformer/worker/inline.js | 2 +- packager/react-packager/src/JSTransformer/worker/worker.js | 2 +- packager/react-packager/src/lib/GlobalTransformCache.js | 2 +- packager/react-packager/src/node-haste/Module.js | 2 +- setupBabel.js | 1 + 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packager/react-packager/react-packager.js b/packager/react-packager/react-packager.js index 9291c540c..86e5b929d 100644 --- a/packager/react-packager/react-packager.js +++ b/packager/react-packager/react-packager.js @@ -14,7 +14,7 @@ const Logger = require('./src/Logger'); const debug = require('debug'); -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); import type {Reporter} from './src/lib/reporting'; diff --git a/packager/react-packager/src/JSTransformer/worker/inline.js b/packager/react-packager/src/JSTransformer/worker/inline.js index 5636e8e4f..c9bdee038 100644 --- a/packager/react-packager/src/JSTransformer/worker/inline.js +++ b/packager/react-packager/src/JSTransformer/worker/inline.js @@ -12,7 +12,7 @@ 'use strict'; const babel = require('babel-core'); -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); import type {Ast, SourceMap} from 'babel-core'; const t = babel.types; diff --git a/packager/react-packager/src/JSTransformer/worker/worker.js b/packager/react-packager/src/JSTransformer/worker/worker.js index 8ae8bc998..d97714dc7 100644 --- a/packager/react-packager/src/JSTransformer/worker/worker.js +++ b/packager/react-packager/src/JSTransformer/worker/worker.js @@ -14,7 +14,7 @@ const constantFolding = require('./constant-folding'); const extractDependencies = require('./extract-dependencies'); const inline = require('./inline'); -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); const minify = require('./minify'); import type {LogEntry} from '../../Logger/Types'; diff --git a/packager/react-packager/src/lib/GlobalTransformCache.js b/packager/react-packager/src/lib/GlobalTransformCache.js index b327dbfcc..e9df77577 100644 --- a/packager/react-packager/src/lib/GlobalTransformCache.js +++ b/packager/react-packager/src/lib/GlobalTransformCache.js @@ -13,7 +13,7 @@ const crypto = require('crypto'); const imurmurhash = require('imurmurhash'); -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); const jsonStableStringify = require('json-stable-stringify'); const path = require('path'); const request = require('request'); diff --git a/packager/react-packager/src/node-haste/Module.js b/packager/react-packager/src/node-haste/Module.js index d0d2b0447..e612ed154 100644 --- a/packager/react-packager/src/node-haste/Module.js +++ b/packager/react-packager/src/node-haste/Module.js @@ -17,7 +17,7 @@ const TransformCache = require('../lib/TransformCache'); const crypto = require('crypto'); const docblock = require('./DependencyGraph/docblock'); const fs = require('fs'); -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); const isAbsolutePath = require('absolute-path'); const jsonStableStringify = require('json-stable-stringify'); diff --git a/setupBabel.js b/setupBabel.js index 53609df2a..657321664 100644 --- a/setupBabel.js +++ b/setupBabel.js @@ -16,6 +16,7 @@ const path = require('path'); const BABEL_ENABLED_PATHS = [ 'packager/react-packager/react-packager.js', 'packager/react-packager/src', + 'packager/transformer.js', 'local-cli', ];