-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(plugins): update plugin developer docs wrt NODE_PATH #10028
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,13 +183,14 @@ function resolveModule(moduleIdentifier, configDir, category) { | |
return require.resolve(cwdPath); | ||
} catch (e) {} | ||
|
||
const errorString = | ||
'Unable to locate ' + | ||
(category ? `${category}: ` : '') + | ||
`${moduleIdentifier} (tried to require() from '${__dirname}' and load from '${cwdPath}'`; | ||
const errorString = 'Unable to locate ' + (category ? `${category}: ` : '') + | ||
`\`${moduleIdentifier}\`. | ||
Tried to require() from these locations: | ||
${__dirname} | ||
${cwdPath}`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we might also spit out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I started this but i'm going to split into a separate PR because NODE_PATH from the node side starts to get pretty complex. |
||
|
||
if (!configDir) { | ||
throw new Error(errorString + ')'); | ||
throw new Error(errorString); | ||
} | ||
|
||
// Finally, try looking up relative to the config file path. Just like the | ||
|
@@ -200,7 +201,8 @@ function resolveModule(moduleIdentifier, configDir, category) { | |
return require.resolve(relativePath); | ||
} catch (requireError) {} | ||
|
||
throw new Error(errorString + ` and '${relativePath}')`); | ||
throw new Error(errorString + ` | ||
${relativePath}`); | ||
} | ||
|
||
module.exports = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
-D
isn't just yarn