From 9ff5b7555913964ebc6c463b00055394c85b8689 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 6 Dec 2019 01:33:06 +0100 Subject: [PATCH] Switch CSS minifier to cssnano (#9260) This results in around 4kB saving in CSS size and also resolves with a particular issue on git bash which had issues with the format of the lessc arguments. --- Makefile | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e5a691fcabc..ffb19dab387 100644 --- a/Makefile +++ b/Makefile @@ -469,9 +469,9 @@ css: node-check $(CSS_DEST) $(CSS_DEST): node_modules $(CSS_SOURCES) npx stylelint web_src/less - npx lessc --clean-css="--s0 -b" web_src/less/index.less public/css/index.css - $(foreach file, $(filter-out web_src/less/themes/_base.less, $(wildcard web_src/less/themes/*)),npx lessc --clean-css="--s0 -b" web_src/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;) - npx postcss --use autoprefixer --no-map --replace public/css/* + npx lessc web_src/less/index.less public/css/index.css + $(foreach file, $(filter-out web_src/less/themes/_base.less, $(wildcard web_src/less/themes/*)),npx lessc web_src/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;) + npx postcss --use autoprefixer --use cssnano --no-map --replace public/css/* .PHONY: javascripts javascripts: diff --git a/package.json b/package.json index 4b3fb2af6f4..ddf32be7f65 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,11 @@ "babel-loader": "8.0.6", "core-js": "3.4.1", "css-loader": "3.2.0", + "cssnano": "4.1.10", "eslint": "6.6.0", "eslint-config-airbnb-base": "14.0.0", "eslint-plugin-import": "2.18.2", "less": "3.10.3", - "less-plugin-clean-css": "1.5.1", "postcss-cli": "6.1.3", "style-loader": "1.0.0", "stylelint": "11.1.1",