Created
September 18, 2018 18:35
-
-
Save davidfirst/f2f7110874e50bbb10f3f8f3f7eb9454 to your computer and use it in GitHub Desktop.
patch-import-path-error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/links/link-generator.js b/src/links/link-generator.js | |
index 62123823..3eaa3019 100644 | |
--- a/src/links/link-generator.js | |
+++ b/src/links/link-generator.js | |
@@ -348,7 +348,7 @@ The dependencies array has the following ids: ${dependencies.map(d => d.id).join | |
return R.flatten(currLinks); | |
}); | |
const internalCustomResolvedLinks = parentComponent.customResolvedPaths.length | |
- ? getInternalCustomResolvedLinks(parentComponent, createNpmLinkFiles) | |
+ ? getInternalCustomResolvedLinks(parentComponent, parentComponentMap, createNpmLinkFiles) | |
: []; | |
const flattenLinks = R.flatten(links).concat(internalCustomResolvedLinks); | |
@@ -426,8 +426,8 @@ The dependencies array has the following ids: ${dependencies.map(d => d.id).join | |
* components/utils/jump/utils/is-string.js | |
* components/utils/jump/node_modules/utils/is-string // this is the file we generate here | |
*/ | |
-function getInternalCustomResolvedLinks(component: Component, createNpmLinkFiles: boolean): LinkFile[] { | |
- const componentDir = component.writtenPath; | |
+function getInternalCustomResolvedLinks(component: Component, componentMap, createNpmLinkFiles: boolean): LinkFile[] { | |
+ const componentDir = component.writtenPath || componentMap.rootDir; | |
const getDestination = (importSource: string) => `node_modules/${importSource}`; | |
return component.customResolvedPaths.map((customPath) => { | |
const sourceAbs = path.join(componentDir, customPath.destinationPath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment