mirror of https://github.com/status-im/metro.git
Add support for passing in additional assetExts to packager
fbshipit-source-id: 42e508e37d960fbeb905a2ea8cb4741dba5c67fc
This commit is contained in:
parent
eeda397983
commit
1fcceb0c5f
|
@ -0,0 +1,16 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2015-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.
|
||||||
|
*/
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = [
|
||||||
|
'bmp', 'gif', 'jpg', 'jpeg', 'png', 'psd', 'svg', 'webp', // Image formats
|
||||||
|
'm4v', 'mov', 'mp4', 'mpeg', 'mpg', 'webm', // Video formats
|
||||||
|
'aac', 'aiff', 'caf', 'm4a', 'mp3', 'wav', // Audio formats
|
||||||
|
'html', 'pdf', // Document formats
|
||||||
|
];
|
|
@ -17,9 +17,10 @@ const Promise = require('promise');
|
||||||
const SourceMapConsumer = require('source-map').SourceMapConsumer;
|
const SourceMapConsumer = require('source-map').SourceMapConsumer;
|
||||||
|
|
||||||
const declareOpts = require('../lib/declareOpts');
|
const declareOpts = require('../lib/declareOpts');
|
||||||
|
const defaultAssetExts = require('../../../defaultAssetExts');
|
||||||
|
const mime = require('mime-types');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const url = require('url');
|
const url = require('url');
|
||||||
const mime = require('mime-types');
|
|
||||||
|
|
||||||
function debounce(fn, delay) {
|
function debounce(fn, delay) {
|
||||||
var timeout;
|
var timeout;
|
||||||
|
@ -71,12 +72,7 @@ const validateOpts = declareOpts({
|
||||||
},
|
},
|
||||||
assetExts: {
|
assetExts: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
default: [
|
default: defaultAssetExts,
|
||||||
'bmp', 'gif', 'jpg', 'jpeg', 'png', 'psd', 'svg', 'webp', // Image formats
|
|
||||||
'm4v', 'mov', 'mp4', 'mpeg', 'mpg', 'webm', // Video formats
|
|
||||||
'aac', 'aiff', 'caf', 'm4a', 'mp3', 'wav', // Audio formats
|
|
||||||
'html', 'pdf', // Document formats
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
transformTimeoutInterval: {
|
transformTimeoutInterval: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const blacklist = require('./blacklist.js');
|
const blacklist = require('./blacklist');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -17,6 +17,10 @@ module.exports = {
|
||||||
return this._getRoots();
|
return this._getRoots();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getAssetExts() {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
|
||||||
getBlacklistRE(platform) {
|
getBlacklistRE(platform) {
|
||||||
return blacklist(platform);
|
return blacklist(platform);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue