Commit b02b0650 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] task for image optimization

parent 25c67621
......@@ -7,6 +7,7 @@ var gulp = require('gulp'),
cssImport = require('gulp-cssimport'),
minifyCss = require('gulp-minify-css'),
browserSync = require('browser-sync'),
imagemin = require('gulp-imagemin'),
argv = require('yargs').argv,
extension = (function() {
if (typeof argv.ext === 'undefined') {
......@@ -16,7 +17,8 @@ var gulp = require('gulp'),
}()),
extensionPath = path.join('typo3conf', 'ext', extension),
sassPath = path.join(extensionPath, 'Resources', 'Public', 'Sass'),
cssPath = path.join(extensionPath, 'Resources', 'Public', 'StyleSheets');
cssPath = path.join(extensionPath, 'Resources', 'Public', 'StyleSheets'),
imagePath = path.join(extensionPath, 'Resources', 'Public', 'Images');
gulp.task('css', function() {
return gulp.src(sassPath + '/**/*.scss')
......@@ -33,6 +35,15 @@ gulp.task('css', function() {
.pipe(browserSync.reload({stream: true}));
});
gulp.task('images', function() {
return gulp.src(imagePath + '/**/*')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(gulp.dest(imagePath));
});
gulp.task('browser-sync', function() {
browserSync.init(null, {
proxy: '<%= browserSyncProxy %>'
......
......@@ -11,6 +11,7 @@
"gulp-compass": "^2.0.3",
"gulp-cssimport": "^1.3.1",
"gulp-minify-css": "^0.3.11",
"gulp-imagemin": "^2.1.0",
"yargs": "^1.3.3"
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment