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
Support double quotes in use imports from built-ins #147
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ export default function rewritePaths(error, file, contents, moduleContext, callb | |
|
||
const rewritten = contents.replace(useRegexp, (entire, importer, single, double, unquoted) => { | ||
// Don't rewrite imports from built-ins | ||
if (single && single.indexOf('sass:') === 0) { | ||
if ([single, double].some(match => match && match.indexOf('sass:') === 0)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we match the quotes into a separate group and become completely indifferent to them @justin808? The regex could be a bit tricky, as for example this might be a valid import |
||
return entire; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@use "sass:math"; | ||
|
||
$padding: #{math.div(4 / 2)}px; |
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.
Not sure what
unquoted
is, or if we should support this as well?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.
No idea.