Skip to content

Commit

Permalink
Fix: @import url() error in dependency resolver (#2632)
Browse files Browse the repository at this point in the history
* Skip url() imports from deps list
* Tests for url() imports in deps resolver
  • Loading branch information
groenroos committed Sep 22, 2021
1 parent 9cb7635 commit d2cddcf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/visitor/deps-resolver.js
Expand Up @@ -110,6 +110,9 @@ DepsResolver.prototype.visitCall = function(call) {
*/

DepsResolver.prototype.visitImport = function(node) {
// If it's a url() call, skip
if (node.path.first.name === 'url') return;

var path = !node.path.first.val.isNull && node.path.first.val || node.path.first.name
, literal, found, oldPath;

Expand Down
2 changes: 2 additions & 0 deletions test/deps-resolver/url.deps
@@ -0,0 +1,2 @@
test/deps-resolver/url/a.styl
test/deps-resolver/url/b.styl
1 change: 1 addition & 0 deletions test/deps-resolver/url.styl
@@ -0,0 +1 @@
@import 'url/a'
2 changes: 2 additions & 0 deletions test/deps-resolver/url/a.styl
@@ -0,0 +1,2 @@
@import url('https://example.com')
@import 'b'
1 change: 1 addition & 0 deletions test/deps-resolver/url/b.styl
@@ -0,0 +1 @@
@import url('http://foo.com/some.styl')

0 comments on commit d2cddcf

Please sign in to comment.