mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 18:44:25 +00:00
packager: ModuleGraph: include all possible asset types
Summary: Afaik. the list of asset types is hardcoded for the Buck worker so far, and I'm not sure how that would be customizable. For now, let's include all the default asset extensions. Reviewed By: davidaurelio Differential Revision: D5002607 fbshipit-source-id: 41069e817d2b73156bca684bc2f73077132928a7
This commit is contained in:
parent
2edbb61aae
commit
e69b81313f
@ -12,8 +12,10 @@
|
||||
|
||||
const babel = require('babel-core');
|
||||
const collectDependencies = require('./collect-dependencies');
|
||||
const defaults = require('../../../defaults');
|
||||
const docblock = require('../../node-haste/DependencyGraph/docblock');
|
||||
const generate = require('./generate');
|
||||
const path = require('path');
|
||||
const series = require('async/series');
|
||||
|
||||
const {basename} = require('path');
|
||||
@ -39,12 +41,14 @@ const defaultVariants = {default: {}};
|
||||
const moduleFactoryParameters = ['global', 'require', 'module', 'exports'];
|
||||
const polyfillFactoryParameters = ['global'];
|
||||
|
||||
const ASSET_EXTENSIONS = new Set(defaults.assetExts);
|
||||
|
||||
function transformModule(
|
||||
content: Buffer,
|
||||
options: TransformOptions,
|
||||
callback: Callback<TransformedSourceFile>,
|
||||
): void {
|
||||
if (options.filename.endsWith('.png')) {
|
||||
if (ASSET_EXTENSIONS.has(path.extname(options.filename).substr(1))) {
|
||||
transformAsset(content, options, callback);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user