Skip to content

Commit

Permalink
[fix] resolve paths in monorepo projects
Browse files Browse the repository at this point in the history
  • Loading branch information
aurimasmi committed Jun 8, 2021
1 parent 363ad04 commit 00b8cc2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

function _path() {
const data = _interopRequireDefault(require("path"));

_path = function () {
return data;
};

return data;
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function getAssetDestPathIOS(asset, scale) {
const suffix = scale === 1 ? '' : `@${scale}x`;
const fileName = `${asset.name + suffix}.${asset.type}`;

return _path().default.join(
asset.httpServerLocation.substr(1).replace(/\.\.\//g, '_'),
fileName,
);
}

var _default = getAssetDestPathIOS;
exports.default = _default;
5 changes: 4 additions & 1 deletion packages/rnv/pluginTemplates/react-native/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"overrides": {
"Libraries/Image/RCTUIImageViewAnimated.m": {
"_currentFrame.CGImage;": "_currentFrame.CGImage ;} else { [super displayLayer:layer];"
},
"Libraries/Image/AssetSourceResolver.js": {
"this.fromSource(path + getScaledAssetPath(this.asset));": "this.fromSource(path + getScaledAssetPath(this.asset).replace(/\\.\\.\\//g, '_'));"
}
}
}
}

0 comments on commit 00b8cc2

Please sign in to comment.