added imageMin task

pull/3113/head
kayone 10 years ago
parent 54bdc72ffa
commit 9db41cf4be

@ -7,5 +7,6 @@ require('./handlebars.js');
require('./copy.js');
require('./less.js');
require('./stripBom.js');
require('./imageMin.js');

@ -0,0 +1,16 @@
var gulp = require('gulp');
var print = require('gulp-print');
var paths = require('./paths.js');
gulp.task('imageMin', function () {
var imagemin = require('gulp-imagemin');
return gulp.src(paths.src.images)
.pipe(imagemin({
progressive: false,
optimizationLevel :4,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(print())
.pipe(gulp.dest(paths.src.images));
});

@ -3,6 +3,7 @@ var less = require('gulp-less');
var print = require('gulp-print');
var paths = require('./paths');
var errorHandler = require('./errorHandler');
gulp.task('less', function () {
return gulp.src([
@ -26,5 +27,6 @@ gulp.task('less', function () {
ieCompat: true,
strictImports: true
}))
.on('error', errorHandler.onError)
.pipe(gulp.dest(paths.dest.content));
});

@ -7,6 +7,7 @@ module.exports = {
scripts: './src/UI/**/*.js',
less: ['./src/UI/**/*.less'],
content: './src/UI/Content/',
images: './src/UI/Content/Images/**/*',
exclude :{
libs:'!./src/UI/JsLibraries/**'
}

@ -15,22 +15,22 @@
"gitHead": "9ff7aa1bf7fe38c4c5bdb92f56c8ad556916ed67",
"readmeFilename": "readme.md",
"dependencies": {
"fs-extra": "^0.11.0",
"gulp": "^3.8.7",
"gulp-handlebars": "^2.2.0",
"gulp-declare": "^0.3.0",
"gulp-cached": "^1.0.1",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.3.4",
"gulp-wrap-amd": "^0.3.1",
"gulp-wrap": "^0.3.0",
"streamqueue": "^0.1.1",
"gulp-replace": "^0.4.0",
"fs-extra": "^0.11.0",
"gulp-print": "^1.1.0",
"gulp-less": "^1.3.5",
"gulp-declare": "^0.3.0",
"gulp-handlebars": "^2.2.0",
"gulp-jshint": "^1.8.4",
"gulp-cached": "^1.0.1",
"gulp-less": "^1.3.5",
"gulp-print": "^1.1.0",
"gulp-replace": "^0.4.0",
"gulp-wrap": "^0.3.0",
"gulp-wrap-amd": "^0.3.1",
"jshint-stylish": "^0.4.0",
"requirejs": "^2.1.14",
"run-sequence": "^0.3.6"
"run-sequence": "^0.3.6",
"streamqueue": "^0.1.1"
}
}

Loading…
Cancel
Save