Use a project's custom platforms when creating a production bundle
Reviewed By: davidaurelio Differential Revision: D4463579 fbshipit-source-id: 0f1514b25239b2fe62fca6fd02a475db98cff3a8
This commit is contained in:
parent
4368719476
commit
a1cd5e0d05
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue