Skip to content

Commit

Permalink
fixup! Adapt Plugin and PluginManager to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
jovyntls committed Feb 11, 2023
1 parent 7bf4758 commit 1822dfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/plugins/PluginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export class PluginManager {
const resolvedPluginPath = require.resolve(pluginName);
return resolvedPluginPath;
} catch (err) {
// Also check the node_modules of the project
// An error may be thrown because the module is not found, or for other reasons.
// If the error is due to MODULE_NOT_FOUND, search project's node_modules
if (_.isError(err) && (err as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') {
return require.resolve(pluginName, { paths: [path.join(projectRootPath, 'node_modules')] });
}
Expand Down

0 comments on commit 1822dfa

Please sign in to comment.