aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Dimitroff <d@thecrazyones.agency>2017-01-03 11:46:22 +0200
committerDarin Dimitroff <d@thecrazyones.agency>2017-01-03 11:46:22 +0200
commit7163e7d16db40a3382167dcec145cd033114227a (patch)
treec061fb0ec6ab9764873f773ef84480ad1cb6eb49
parented4be926a7217018e052e3fecda92e4ee671d950 (diff)
Adds uncss and cssnano dependencies
Signed-off-by: Darin Dimitroff <d@thecrazyones.agency>
-rw-r--r--gulpfile.babel.js9
-rw-r--r--package.json4
2 files changed, 11 insertions, 2 deletions
diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index 06f9435..1300d4c 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -10,6 +10,8 @@ import webpackConfig from "./webpack.conf";
import svgstore from "gulp-svgstore";
import svgmin from "gulp-svgmin";
import inject from "gulp-inject";
+import cssnano from "cssnano";
+import uncss from "postcss-uncss";
const browserSync = BrowserSync.create();
const hugoBin = "hugo";
@@ -23,7 +25,12 @@ gulp.task("build-preview", ["css", "js", "hugo-preview"]);
gulp.task("css", () => (
gulp.src("./src/css/*.css")
- .pipe(postcss([cssImport({from: "./src/css/main.css"}), cssnext()]))
+ .pipe(postcss([
+ cssImport({from: "./src/css/main.css"}),
+ cssnext(),
+ cssnano(),
+ uncss({ html: ['site/**/*.html']})
+ ]))
.pipe(gulp.dest("./dist/css"))
.pipe(browserSync.stream())
));
diff --git a/package.json b/package.json
index c6f93c8..d004443 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
"author": "",
"license": "MIT",
"dependencies": {
- "autoprefixer": "^6.3.7",
+ "autoprefixer": "^6.6.0",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.4",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
@@ -25,6 +25,7 @@
"babel-register": "^6.11.6",
"browser-sync": "^2.13.0",
"css-loader": "^0.23.1",
+ "cssnano": "^3.9.1",
"eslint": "^3.1.1",
"eslint-plugin-import": "^1.11.1",
"exports-loader": "^0.6.3",
@@ -37,6 +38,7 @@
"postcss-cssnext": "^2.7.0",
"postcss-import": "^8.1.2",
"postcss-loader": "^0.9.1",
+ "postcss-uncss": "^0.14.0",
"url-loader": "^0.5.7",
"webpack": "^1.13.1",
"whatwg-fetch": "^1.0.0"