Permalink
Browse files

Use a project's custom platforms when creating a production bundle

Reviewed By: davidaurelio

Differential Revision: D4463579

fbshipit-source-id: 0f1514b25239b2fe62fca6fd02a475db98cff3a8
  • Loading branch information...
andrewimm authored and facebook-github-bot committed Jan 27, 2017
1 parent 4368719 commit a1cd5e0d05ab0bb5a3dc03ac470319e5b6764a4c
Showing with 3 additions and 0 deletions.
  1. +3 −0 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,

0 comments on commit a1cd5e0

Please sign in to comment.