Skip to content

Commit

Permalink
Replace cssnano with csso (#807)
Browse files Browse the repository at this point in the history
Closes #806.
  • Loading branch information
davidtheclark authored Jul 2, 2017
1 parent 2bddd56 commit 66b2d9e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 363 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 0.13.1
## 0.13.1-2

- Fix syntax of Browserslist for Autoprefixer.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mapbox/assembly",
"version": "0.13.1",
"version": "0.13.2",
"description": "A CSS framework",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -39,7 +39,7 @@
"autoprefixer": "^6.6.1",
"concat-with-sourcemaps": "^1.0.4",
"cp-file": "^4.1.1",
"cssnano": "^3.10.0",
"csso": "^3.1.1",
"globby": "^6.1.0",
"indent-string": "^3.1.0",
"mkdirp": "^0.5.1",
Expand Down
7 changes: 3 additions & 4 deletions scripts/build-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const mkdirp = require('mkdirp');
const PQueue = require('p-queue');
const Concat = require('concat-with-sourcemaps');
const postcss = require('postcss');
const cssnano = require('cssnano');
const csso = require('csso');
const reporter = require('postcss-reporter');
const autoprefixer = require('autoprefixer');
const initPostcssCustomProperties = require('postcss-custom-properties');
Expand Down Expand Up @@ -140,9 +140,8 @@ function buildCss(options) {
const css = `${concat.content}\n/*# sourceMappingURL=${outfileFilename}.map */`;

function writeMinifiedCss() {
return cssnano.process(css).then((minifiedCss) => {
pify(fs.writeFile)(outfile.replace('.css', '.min.css'), minifiedCss, 'utf8');
});
const minifiedCss = csso.minify(css).css;
return pify(fs.writeFile)(outfile.replace('.css', '.min.css'), minifiedCss, 'utf8');
}

return pify(mkdirp)(path.dirname(outfile)).then(() => {
Expand Down
Loading

0 comments on commit 66b2d9e

Please sign in to comment.