Skip to content

Commit

Permalink
Fix issue import-js#793
Browse files Browse the repository at this point in the history
  • Loading branch information
ephys committed Aug 24, 2018
1 parent dbd69dd commit d6fea11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/importType.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export function isBuiltIn(name, settings) {

function isExternalPath(path, name, settings) {
const folders = (settings && settings['import/external-module-folders']) || ['node_modules']
return !path || folders.some(folder => -1 < path.indexOf(join(folder, name)))

// extract the part before the first / (redux-saga/effects => redux-saga)
const packageName = name.match(/([^\/]+)/)[0]

return !path || folders.some(folder => -1 < path.indexOf(join(folder, packageName)))
}

const externalModuleRegExp = /^\w/
Expand Down

0 comments on commit d6fea11

Please sign in to comment.