mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
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 path = require('path');
|
||||||
const saveAssets = require('./saveAssets');
|
const saveAssets = require('./saveAssets');
|
||||||
const defaultAssetExts = require('../../packager/defaults').assetExts;
|
const defaultAssetExts = require('../../packager/defaults').assetExts;
|
||||||
|
const defaultPlatforms = require('../../packager/defaults').platforms;
|
||||||
const defaultProvidesModuleNodeModules = require('../../packager/defaults').providesModuleNodeModules;
|
const defaultProvidesModuleNodeModules = require('../../packager/defaults').providesModuleNodeModules;
|
||||||
|
|
||||||
import type {RequestOptions, OutputOptions} from './types.flow';
|
import type {RequestOptions, OutputOptions} from './types.flow';
|
||||||
@ -58,6 +59,7 @@ function buildBundle(
|
|||||||
var shouldClosePackager = false;
|
var shouldClosePackager = false;
|
||||||
if (!packagerInstance) {
|
if (!packagerInstance) {
|
||||||
const assetExts = (config.getAssetExts && config.getAssetExts()) || [];
|
const assetExts = (config.getAssetExts && config.getAssetExts()) || [];
|
||||||
|
const platforms = (config.getPlatforms && config.getPlatforms()) || [];
|
||||||
|
|
||||||
const transformModulePath =
|
const transformModulePath =
|
||||||
args.transformer ? path.resolve(args.transformer) :
|
args.transformer ? path.resolve(args.transformer) :
|
||||||
@ -74,6 +76,7 @@ function buildBundle(
|
|||||||
extraNodeModules: config.extraNodeModules,
|
extraNodeModules: config.extraNodeModules,
|
||||||
getTransformOptions: config.getTransformOptions,
|
getTransformOptions: config.getTransformOptions,
|
||||||
globalTransformCache: null,
|
globalTransformCache: null,
|
||||||
|
platforms: defaultPlatforms.concat(platforms),
|
||||||
projectRoots: config.getProjectRoots(),
|
projectRoots: config.getProjectRoots(),
|
||||||
providesModuleNodeModules: providesModuleNodeModules,
|
providesModuleNodeModules: providesModuleNodeModules,
|
||||||
resetCache: args.resetCache,
|
resetCache: args.resetCache,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user