mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-28 08:07:25 +08:00
Revert packager randomization revert
This commit is contained in:
committed by
facebook-github-bot-7
parent
23564fe65a
commit
1487ebfe01
@@ -252,6 +252,11 @@ class ResolutionRequest {
|
||||
_loadAsFile(potentialModulePath) {
|
||||
return Promise.resolve().then(() => {
|
||||
if (this._helpers.isAssetFile(potentialModulePath)) {
|
||||
const dirname = path.dirname(potentialModulePath);
|
||||
if (!this._fastfs.dirExists(dirname)) {
|
||||
throw new UnableToResolveError(`Directory ${dirname} doesn't exist`);
|
||||
}
|
||||
|
||||
const {name, type} = getAssetDataFromName(potentialModulePath);
|
||||
|
||||
let pattern = '^' + name + '(@[\\d\\.]+x)?';
|
||||
@@ -263,7 +268,7 @@ class ResolutionRequest {
|
||||
// We arbitrarly grab the first one, because scale selection
|
||||
// will happen somewhere
|
||||
const [assetFile] = this._fastfs.matches(
|
||||
path.dirname(potentialModulePath),
|
||||
dirname,
|
||||
new RegExp(pattern)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user