Skip to content

Commit 87cf221

Browse files
committed
Fix issue import-js#793
1 parent 65fd4c9 commit 87cf221

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/importType.js

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

2020
function isExternalPath(path, name, settings) {
2121
const folders = (settings && settings['import/external-module-folders']) || ['node_modules']
22-
return !path || folders.some(folder => -1 < path.indexOf(join(folder, name)))
22+
23+
// extract the part before the first / (redux-saga/effects => redux-saga)
24+
const packageName = name.match(/([^\/]+)/)[0]
25+
26+
return !path || folders.some(folder => -1 < path.indexOf(join(folder, packageName)))
2327
}
2428

2529
const externalModuleRegExp = /^\w/

0 commit comments

Comments
 (0)