mirror of https://github.com/webpack/webpack.git
fix: perf
This commit is contained in:
parent
fb1d14e64a
commit
4e8f8144fd
|
|
@ -812,24 +812,26 @@ class CssParser extends Parser {
|
|||
return end;
|
||||
},
|
||||
pseudoClass: (input, start, end) => {
|
||||
switch (mode) {
|
||||
case CSS_MODE_TOP_LEVEL: {
|
||||
const name = input.slice(start, end).toLowerCase();
|
||||
if (this.allowModeSwitch && name === ":global") {
|
||||
modeData = "global";
|
||||
const dep = new ConstDependency("", [start, end]);
|
||||
module.addPresentationalDependency(dep);
|
||||
} else if (this.allowModeSwitch && name === ":local") {
|
||||
modeData = "local";
|
||||
const dep = new ConstDependency("", [start, end]);
|
||||
module.addPresentationalDependency(dep);
|
||||
} else if (this.allowPseudoBlocks && name === ":export") {
|
||||
const pos = parseExports(input, end);
|
||||
const dep = new ConstDependency("", [start, pos]);
|
||||
module.addPresentationalDependency(dep);
|
||||
return pos;
|
||||
if (this.allowModeSwitch) {
|
||||
switch (mode) {
|
||||
case CSS_MODE_TOP_LEVEL: {
|
||||
const name = input.slice(start, end).toLowerCase();
|
||||
if (name === ":global") {
|
||||
modeData = "global";
|
||||
const dep = new ConstDependency("", [start, end]);
|
||||
module.addPresentationalDependency(dep);
|
||||
} else if (name === ":local") {
|
||||
modeData = "local";
|
||||
const dep = new ConstDependency("", [start, end]);
|
||||
module.addPresentationalDependency(dep);
|
||||
} else if (name === ":export") {
|
||||
const pos = parseExports(input, end);
|
||||
const dep = new ConstDependency("", [start, pos]);
|
||||
module.addPresentationalDependency(dep);
|
||||
return pos;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return end;
|
||||
|
|
|
|||
|
|
@ -395,6 +395,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
@unknown .class {
|
||||
color: red;
|
||||
}
|
||||
|
||||
:scope {
|
||||
color: red;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue