Merge pull request #11943 from Snuffleupagus/cleanup-preprocessCSS
Remove unused code from the `external/builder/builder.js` file
This commit is contained in:
commit
878619956b
19
external/builder/builder.js
vendored
19
external/builder/builder.js
vendored
@ -196,19 +196,9 @@ function preprocess(inFilename, outFilename, defines) {
|
|||||||
}
|
}
|
||||||
exports.preprocess = preprocess;
|
exports.preprocess = preprocess;
|
||||||
|
|
||||||
var deprecatedInMozcentral = new RegExp(
|
|
||||||
"(^|\\W)(" + ["-moz-box-sizing", "-moz-grab", "-moz-grabbing"].join("|") + ")"
|
|
||||||
);
|
|
||||||
|
|
||||||
function preprocessCSS(mode, source, destination) {
|
function preprocessCSS(mode, source, destination) {
|
||||||
function hasPrefixedFirefox(line) {
|
|
||||||
return /(^|\W)-(ms|o|webkit)-\w/.test(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hasPrefixedMozcentral(line) {
|
function hasPrefixedMozcentral(line) {
|
||||||
return (
|
return /(^|\W)-(ms|o|webkit)-\w/.test(line);
|
||||||
/(^|\W)-(ms|o|webkit)-\w/.test(line) || deprecatedInMozcentral.test(line)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function expandImports(content, baseUrl) {
|
function expandImports(content, baseUrl) {
|
||||||
@ -275,11 +265,8 @@ function preprocessCSS(mode, source, destination) {
|
|||||||
|
|
||||||
var content = fs.readFileSync(source, "utf8").toString();
|
var content = fs.readFileSync(source, "utf8").toString();
|
||||||
content = expandImports(content, source);
|
content = expandImports(content, source);
|
||||||
if (mode === "mozcentral" || mode === "firefox") {
|
if (mode === "mozcentral") {
|
||||||
content = removePrefixed(
|
content = removePrefixed(content, hasPrefixedMozcentral);
|
||||||
content,
|
|
||||||
mode === "mozcentral" ? hasPrefixedMozcentral : hasPrefixedFirefox
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
fs.writeFileSync(destination, content);
|
fs.writeFileSync(destination, content);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user