Enforce by default a local FileStore cache

Reviewed By: davidaurelio

Differential Revision: D7774249

fbshipit-source-id: ec00cfc4982fa1077a9b6e9cd2be419f59323595
This commit is contained in:
Miguel Jimenez Esun 2018-04-26 12:04:03 -07:00 committed by Facebook Github Bot
parent b6494d8f81
commit 3c1cf9f688
1 changed files with 7 additions and 1 deletions

View File

@ -10,9 +10,11 @@
'use strict'; 'use strict';
const blacklist = require('./blacklist'); const blacklist = require('./blacklist');
const os = require('os');
const path = require('path'); const path = require('path');
const {providesModuleNodeModules} = require('./defaults'); const {providesModuleNodeModules} = require('./defaults');
const {FileStore} = require('metro-cache');
import type { import type {
GetTransformOptions, GetTransformOptions,
@ -178,7 +180,11 @@ const DEFAULT = ({
enhanceMiddleware: middleware => middleware, enhanceMiddleware: middleware => middleware,
extraNodeModules: {}, extraNodeModules: {},
assetTransforms: false, assetTransforms: false,
cacheStores: [], cacheStores: [
new FileStore({
root: path.join(os.tmpdir(), 'metro-cache'),
}),
],
cacheVersion: '1.0', cacheVersion: '1.0',
dynamicDepsInPackages: 'throwAtRuntime', dynamicDepsInPackages: 'throwAtRuntime',
getAsyncRequireModulePath: () => 'metro/src/lib/bundle-modules/asyncRequire', getAsyncRequireModulePath: () => 'metro/src/lib/bundle-modules/asyncRequire',