mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 15:45:32 +00:00
metro-bundler: remove hardcoded AssetRegistry path
Reviewed By: davidaurelio Differential Revision: D5452553 fbshipit-source-id: e0a6f56d3bc03f4ba7f34fbee1ae418495dcc6cd
This commit is contained in:
parent
fc38fe1736
commit
65769b0c33
@ -25,6 +25,8 @@ const defaultSourceExts = require('metro-bundler/src/defaults').sourceExts;
|
||||
const defaultPlatforms = require('metro-bundler/src/defaults').platforms;
|
||||
const defaultProvidesModuleNodeModules = require('metro-bundler/src/defaults').providesModuleNodeModules;
|
||||
|
||||
const {ASSET_REGISTRY_PATH} = require('../core/Constants');
|
||||
|
||||
import type {RequestOptions, OutputOptions} from './types.flow';
|
||||
import type {ConfigT} from '../util/Config';
|
||||
|
||||
@ -85,6 +87,7 @@ function buildBundle(
|
||||
const terminal = new Terminal(process.stdout);
|
||||
const options = {
|
||||
assetExts: defaultAssetExts.concat(assetExts),
|
||||
assetRegistryPath: ASSET_REGISTRY_PATH,
|
||||
blacklistRE: config.getBlacklistRE(),
|
||||
extraNodeModules: config.extraNodeModules,
|
||||
getPolyfills: config.getPolyfills,
|
||||
|
17
local-cli/core/Constants.js
Normal file
17
local-cli/core/Constants.js
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) 2016-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const ASSET_REGISTRY_PATH = 'react-native/Libraries/Image/AssetRegistry';
|
||||
|
||||
module.exports = {ASSET_REGISTRY_PATH};
|
@ -39,6 +39,8 @@ const webSocketProxy = require('./util/webSocketProxy.js');
|
||||
|
||||
const TransformCaching = require('metro-bundler/src/lib/TransformCaching');
|
||||
|
||||
const {ASSET_REGISTRY_PATH} = require('../core/Constants');
|
||||
|
||||
import type {ConfigT} from '../util/Config';
|
||||
import type {Reporter} from 'metro-bundler/src/lib/reporting';
|
||||
|
||||
@ -147,6 +149,7 @@ function getPackagerServer(args, config) {
|
||||
const terminal = new Terminal(process.stdout);
|
||||
return ReactPackager.createServer({
|
||||
assetExts: defaultAssetExts.concat(args.assetExts),
|
||||
assetRegistryPath: ASSET_REGISTRY_PATH,
|
||||
blacklistRE: config.getBlacklistRE(),
|
||||
cacheVersion: '3',
|
||||
extraNodeModules: config.extraNodeModules,
|
||||
|
Loading…
x
Reference in New Issue
Block a user