From de4356b6c869553c843f48e032432b4f8dfacb71 Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Sun, 23 Apr 2017 22:30:32 +0300 Subject: [PATCH] fix: case insensitivity of @import (#514) --- lib/processCss.js | 2 +- test/importTest.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/processCss.js b/lib/processCss.js index fb2ad703..2c2fea6d 100644 --- a/lib/processCss.js +++ b/lib/processCss.js @@ -41,7 +41,7 @@ var parserPlugin = postcss.plugin("css-loader-parser", function(options) { } if(options.import) { - css.walkAtRules("import", function(rule) { + css.walkAtRules(/import/i, function(rule) { var values = Tokenizer.parseValues(rule.params); var url = values.nodes[0].nodes[0]; if(url.type === "url") { diff --git a/test/importTest.js b/test/importTest.js index 19efac8b..52c94510 100644 --- a/test/importTest.js +++ b/test/importTest.js @@ -9,6 +9,12 @@ describe("import", function() { ], "", { "./test.css": [[2, ".test{a: b}", ""]] }); + test("import camelcase", "@IMPORT url(test.css);\n.class { a: b c d; }", [ + [2, ".test{a: b}", ""], + [1, ".class { a: b c d; }", ""] + ], "", { + "./test.css": [[2, ".test{a: b}", ""]] + }); test("import with string", "@import \"test.css\";\n.class { a: b c d; }", [ [2, ".test{a: b}", ""], [1, ".class { a: b c d; }", ""]