Skip to content

Commit

Permalink
Replace cssnano optimisation step with 'compressed' output style of…
Browse files Browse the repository at this point in the history
… `sass`.
  • Loading branch information
Lea Hayes committed Sep 20, 2022
1 parent 33ebcca commit 7fbbe80
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 608 deletions.
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const terserOptions = {

const sassOptions = {
includePaths: ['./node_modules/normalize.css', './node_modules/prismjs/themes'],
outputStyle: 'compressed',
};

const scripts = [
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"cheerio": "^1.0.0-rc.10",
"codecov": "^3.8.3",
"core-js": "^3.21.1",
"cssnano": "^4.1.11",
"dialog-polyfill": "^0.5.6",
"eslint": "^5.9.0",
"eslint-cli": "^1.1.1",
Expand Down
12 changes: 0 additions & 12 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import postcssUrl from 'postcss-url';
import autoprefixer from 'autoprefixer';
import cssnano from 'cssnano';

const BASE_HREF = '';
const DEPLOY_URL = '';

export default () => {
// safe settings based on: https://github.com/ben-eb/cssnano/issues/358#issuecomment-283696193
const minimizeOptions = {
autoprefixer: false,
safe: true,
mergeLonghand: false,
discardComments: {
removeAll: true,
},
};

return [
postcssUrl({
url: ({ url }) => {
Expand All @@ -40,6 +29,5 @@ export default () => {
},
}),
autoprefixer(),
cssnano(minimizeOptions),
];
};
Loading

0 comments on commit 7fbbe80

Please sign in to comment.