First try scss when there's an @import with comma (#2225)

It's annoying that the less parser is so lenient that it drops things instead of throwing :(

Fixes #2125
This commit is contained in:
Christopher Chedeau authored and GitHub committed 2017-06-21 15:45:55 -07:00
1 parent aac0d1dda0
commit c36dd48339
3 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -209,7 +209,7 @@ function requireParser(isSCSS) {
}
function parse(text) {
const isLikelySCSS = !!text.match(/(\w\s*: [^}:]+|#){|\@import url/);
const isLikelySCSS = !!text.match(/(\w\s*: [^}:]+|#){|\@import[^\n]+(url|,)/);
try {
return parseWithParser(requireParser(isLikelySCSS), text);
} catch (e) {
@@ -1,5 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`import_comma.css 1`] = `
@import "rounded-corners", "text-shadow";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@import "rounded-corners", "text-shadow";
`;
exports[`scss.css 1`] = `
@media #{$g-breakpoint-tiny} {}
.#{$fa-css-prefix}-glass:before { content: $fa-var-glass; }
+1
View File
@@ -0,0 +1 @@
@import "rounded-corners", "text-shadow";