mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 23:05:00 +08:00
Improve performance of node-haste2 and react-packager
Reviewed By: davidaurelio Differential Revision: D2911210 fb-gh-sync-id: 8ac2f213e8a9e089281bb065f9a7190d2e0f5b18 shipit-source-id: 8ac2f213e8a9e089281bb065f9a7190d2e0f5b18
This commit is contained in:
committed by
facebook-github-bot-8
parent
9856a97267
commit
9a918ef48f
@@ -3,7 +3,7 @@
|
||||
const AssetModule = require('./AssetModule');
|
||||
const Package = require('./Package');
|
||||
const Module = require('./Module');
|
||||
const path = require('path');
|
||||
const path = require('fast-path');
|
||||
|
||||
class ModuleCache {
|
||||
|
||||
@@ -26,7 +26,6 @@ class ModuleCache {
|
||||
}
|
||||
|
||||
getModule(filePath) {
|
||||
filePath = path.resolve(filePath);
|
||||
if (!this._moduleCache[filePath]) {
|
||||
this._moduleCache[filePath] = new Module({
|
||||
file: filePath,
|
||||
@@ -46,7 +45,6 @@ class ModuleCache {
|
||||
}
|
||||
|
||||
getAssetModule(filePath) {
|
||||
filePath = path.resolve(filePath);
|
||||
if (!this._moduleCache[filePath]) {
|
||||
this._moduleCache[filePath] = new AssetModule({
|
||||
file: filePath,
|
||||
@@ -59,7 +57,6 @@ class ModuleCache {
|
||||
}
|
||||
|
||||
getPackage(filePath) {
|
||||
filePath = path.resolve(filePath);
|
||||
if (!this._packageCache[filePath]) {
|
||||
this._packageCache[filePath] = new Package({
|
||||
file: filePath,
|
||||
|
||||
Reference in New Issue
Block a user