From a1cd5e0d05ab0bb5a3dc03ac470319e5b6764a4c Mon Sep 17 00:00:00 2001 From: Andrew Imm Date: Thu, 26 Jan 2017 16:12:00 -0800 Subject: [PATCH] Use a project's custom platforms when creating a production bundle Reviewed By: davidaurelio Differential Revision: D4463579 fbshipit-source-id: 0f1514b25239b2fe62fca6fd02a475db98cff3a8 --- local-cli/bundle/buildBundle.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/local-cli/bundle/buildBundle.js b/local-cli/bundle/buildBundle.js index c65f53434..c0340b053 100644 --- a/local-cli/bundle/buildBundle.js +++ b/local-cli/bundle/buildBundle.js @@ -19,6 +19,7 @@ const outputBundle = require('./output/bundle'); const path = require('path'); const saveAssets = require('./saveAssets'); const defaultAssetExts = require('../../packager/defaults').assetExts; +const defaultPlatforms = require('../../packager/defaults').platforms; const defaultProvidesModuleNodeModules = require('../../packager/defaults').providesModuleNodeModules; import type {RequestOptions, OutputOptions} from './types.flow'; @@ -58,6 +59,7 @@ function buildBundle( var shouldClosePackager = false; if (!packagerInstance) { const assetExts = (config.getAssetExts && config.getAssetExts()) || []; + const platforms = (config.getPlatforms && config.getPlatforms()) || []; const transformModulePath = args.transformer ? path.resolve(args.transformer) : @@ -74,6 +76,7 @@ function buildBundle( extraNodeModules: config.extraNodeModules, getTransformOptions: config.getTransformOptions, globalTransformCache: null, + platforms: defaultPlatforms.concat(platforms), projectRoots: config.getProjectRoots(), providesModuleNodeModules: providesModuleNodeModules, resetCache: args.resetCache,