Skip to content

Commit

Permalink
handle tilde imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Asad Memon committed Mar 20, 2020
1 parent 8d68e58 commit ee47fad
Show file tree
Hide file tree
Showing 2 changed files with 453 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/dep-tree-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ function getPackages(file) {
imports.strings.forEach(imp => {
imp = trimPackageName(imp);
// skip relative imports and built-in imports (on newer node versions only)
if (!imp.startsWith(".") && !builtInPackages.includes(imp)) {
if (
!imp.startsWith("~") &&
!imp.startsWith(".") &&
!builtInPackages.includes(imp)
) {
deps.push(imp);
}
});
Expand Down
Loading

0 comments on commit ee47fad

Please sign in to comment.