Skip to content

Commit 7f67b16

Browse files
committed
Fix peer dependency issue. Replacing alias to point host repo if its peer dependency
1 parent 1aa281d commit 7f67b16

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "packagebind",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "Connect packages to your application with HMR and babel config",
55
"main": "lib/index.js",
66
"repository": "https://github.com/interviewstreet/packagebind.git",

src/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ export default function packagebind (babelConfig) {
8585
* If its not defined add peer dependency to alias and point it
8686
* to main repo module.
8787
*/
88-
if (aliasPath && aliasPath.startsWith(module)) {
89-
aliasObj[module] = aliasPath.replace(module, currentRepoDir);
88+
89+
const repoModulePath = path.resolve(rootPath, 'node_modules', module);
90+
91+
if (aliasPath && aliasPath.startsWith(repoModulePath)) {
92+
aliasObj[module] = aliasPath.replace(rootPath, currentRepoDir);
9093
} else if (!aliasPath) {
9194
aliasObj[module] = path.resolve(currentRepoDir, 'node_modules', module);
9295
}

0 commit comments

Comments
 (0)