Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: gulpfile.js

Issue 29637578: Issue 6182 - Add build step for fonts and images in help.eyeo.com (Closed) Base URL: https://hg.adblockplus.org/help.eyeo.com
Patch Set: Created Dec. 13, 2017, 12:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .hgignore ('k') | package.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gulpfile.js
===================================================================
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -20,16 +20,17 @@
const gutil = require("gulp-util");
const sourcemaps = require("gulp-sourcemaps");
const rename = require("gulp-rename");
const sass = require("gulp-sass");
const postcss = require("gulp-postcss");
const scss = require("postcss-scss");
const autoprefixer = require("autoprefixer");
const minify = require("gulp-minify");
+const imagemin = require('gulp-imagemin');
/******************************************************************************
* CSS
******************************************************************************/
gulp.task("css", function() {
return gulp.src("./static/src/scss/main.scss")
.pipe(sourcemaps.init())
@@ -52,21 +53,59 @@
ext: {min:".min.js"},
preserveComments: "some"
}))
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest("./static/dist/js"))
});
/******************************************************************************
+ * Images
+ ******************************************************************************/
+
+gulp.task("img", function() {
+ return gulp.src(["./static/src/img/**"])
+ .pipe(imagemin([
+ imagemin.svgo({
+ plugins: [
+ {removeDimensions: false},
+ {removeXMLNS: false},
+ {cleanupIDs: true}
+ ]
+ })
+ ]))
+ .pipe(gulp.dest("./static/dist/img"));
+});
+
+/******************************************************************************
+ * Fonts
+ ******************************************************************************/
+
+gulp.task("fonts", function() {
+ return gulp.src(["./static/src/fonts/**"])
+ .pipe(imagemin([
+ imagemin.svgo({
+ plugins: [
+ {removeDimensions: false},
+ {removeXMLNS: false},
+ {cleanupIDs: true}
+ ]
+ })
+ ]))
+ .pipe(gulp.dest("./static/dist/fonts"));
+});
+
+/******************************************************************************
* Watch
******************************************************************************/
gulp.task("watch", function() {
gulp.watch("./static/src/scss/**/*.scss", ["css"]);
gulp.watch("./static/src/js/**/*.js", ["js"]);
+ gulp.watch("./static/src/img/**", ["img"]);
+ gulp.watch("./static/src/fonts/**", ["fonts"]);
});
/******************************************************************************
* Default
******************************************************************************/
-gulp.task("default", ["css", "js", "watch"]);
+gulp.task("default", ["css", "js", "img", "fonts", "watch"]);
« no previous file with comments | « .hgignore ('k') | package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld