New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: @import
url() error in dependency resolver
#2632
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://developer.mozilla.org/en-US/docs/Web/CSS/@import#examples
Awesome pull request, thank you. I have a small request, can you add more complex unit test for this bugfix ? Current test case looks like function spec unit test, we can add more e2e-like tests, for example:
Input:
// import.url.styl
@import url('https://fonts.googleapis.com/css)
@import xxx;
// more code
Output:
// import.url.css
@import url('https://fonts.googleapis.com/css)
// gen code
There are many e2e-like tests in stylus/test/cases/*
, more unit test cases is always a good thing, thank you again.
@iChenLei Thanks for the review! I reckoned the e2e tests were already covered by stylus/test/cases/import.include.resolver.absolute.styl Lines 1 to 4 in 9cb7635
In any case, this issue seems to be specific to generating the deps list with the Let me know if there's some specific case that I should cover! |
@import
url() error in dependency resolver
@iChenLei Let me know if there is anything further to be done for this PR! I don't have write access so I cannot merge it myself. |
@groenroos Check your permission please, I think you can merge this pr by yourself now. If encount any issue please @ me again. Thanks! Anyway, every pull request need peer review ! We should ensure pull request's quality. |
What: Fixes #2595
Why: Because
@import url()
returns an error for the.deps()
/--deps
flagHow: Add a check to
DepsResolver.prototype.visitImport
to skipurl()
imports from dependency resolver, and thus from dependency listsChecklist:
Comments
url()
should or should not be included in the deps list (the documentation is not explicit about this) - however I've opted to skip them from the deps list, since they'll be almost necessarily external to the consumer codebase