Skip to content

Commit

Permalink
Merge branch 'fix/resolve-monorepo-assets-paths' into feat/merges
Browse files Browse the repository at this point in the history
* fix/resolve-monorepo-assets-paths:
  [fix] resolve paths in monorepo projects

# Conflicts:
#	packages/rnv/pluginTemplates/react-native/[email protected]
  • Loading branch information
pavjacko committed Aug 19, 2021
2 parents 7d8d380 + 00b8cc2 commit d295030
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 @@ -8,6 +8,9 @@
},
"ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm": {
"RCTBridgeModuleNameForClass(module))": "RCTBridgeModuleNameForClass(Class(module)))"
},
"Libraries/Image/AssetSourceResolver.js": {
"this.fromSource(path + getScaledAssetPath(this.asset));": "this.fromSource(path + getScaledAssetPath(this.asset).replace(/\\.\\.\\//g, '_'));"
}
}
}
}

0 comments on commit d295030

Please sign in to comment.