Skip to content

Commit ecd0291

Browse files
committed
Fix issue import-js#793
1 parent 2c8375b commit ecd0291

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/core/importType.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export function isBuiltIn(name, settings) {
2929

3030
function isExternalPath(path, name, settings) {
3131
const folders = (settings && settings['import/external-module-folders']) || ['node_modules']
32-
return !path || folders.some(folder => -1 < path.indexOf(join(folder, name)))
32+
33+
// extract the part before the first / (redux-saga/effects => redux-saga)
34+
const packageName = name.match(/([^\/]+)/)[0]
35+
36+
return !path || folders.some(folder => -1 < path.indexOf(join(folder, packageName)))
3337
}
3438

3539
const externalModuleRegExp = /^\w/

0 commit comments

Comments
 (0)