Skip to content

Commit 9e27dfc

Browse files
committed
disable @import resolving by css-loader set the option to false, set @import url('https://fonts.googleapis.com/css?family=Roboto');` to empty
1 parent c35d8bd commit 9e27dfc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = function(content, map) {
6565
}).map(function(imp) {
6666
if(!loaderUtils.isUrlRequest(imp.url, root)) {
6767
return "exports.push([module.id, " +
68-
JSON.stringify("@import url(" + imp.url + ");") + ", " +
68+
JSON.stringify((query.import ? "" : "/*!\n") + "@import url(" + imp.url + ");" + (query.import ? "" : "\n*/")) + ", " +
6969
JSON.stringify(imp.mediaQuery) + "]);";
7070
} else {
7171
var importUrl = importUrlPrefix + imp.url;

lib/processCss.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var parserPlugin = postcss.plugin("css-loader-parser", function(options) {
4141
return str;
4242
}
4343

44-
if(options.import) {
44+
//if(options.import) {
4545
css.walkAtRules(/^import$/i, function(rule) {
4646
var values = Tokenizer.parseValues(rule.params);
4747
var url = values.nodes[0].nodes[0];
@@ -64,7 +64,7 @@ var parserPlugin = postcss.plugin("css-loader-parser", function(options) {
6464
});
6565
rule.remove();
6666
});
67-
}
67+
//}
6868

6969
var icss = icssUtils.extractICSS(css);
7070
exports = icss.icssExports;

0 commit comments

Comments
 (0)