Skip to content

Commit

Permalink
fix: ignore errors from loadModule utility, closes #223
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jan 26, 2020
1 parent e118cb1 commit c0a29b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utils/load-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import importCwd from 'import-cwd'

export function loadModule(moduleId) {
// Trying to load module normally (relative to plugin directory)
const path = require.resolve(moduleId)
if (path) {
return require(path)
try {
return require(moduleId)
} catch (err) {
// Ignore error
}

// Then, trying to load it relative to CWD
Expand Down

0 comments on commit c0a29b0

Please sign in to comment.