Commit 441a0c6e authored by konfiot's avatar konfiot

La ça marche et en plus c'est minifié

parent bc008d02
......@@ -3,6 +3,7 @@
var gulp = require('gulp');
var fs = require('fs');
var uglify = require('gulp-uglify-es').default;
var $ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'main-bower-files', 'uglify-save-license', 'del']
});
......@@ -30,9 +31,8 @@ gulp.task('partials', function () {
});
gulp.task('html', ['wiredep', 'scripts', 'partials'], function () {
var htmlFilter = $.filter('*.html');
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');
var htmlFilter = $.filter('*.html', {restore: true}); var jsFilter = $.filter('**/*.js', {restore: true});
var cssFilter = $.filter('**/*.css', {restore: true});
var assets;
fs.writeFileSync('dist/version.json', JSON.stringify({build_date: new Date()}));
......@@ -47,28 +47,28 @@ gulp.task('html', ['wiredep', 'scripts', 'partials'], function () {
.pipe($.useref({ searchPath: 'app' }))
//.pipe($.rev())
.pipe($.rev())
.pipe($.debug({title: 'unicorn:'}))
//.pipe(jsFilter)
//.pipe($.stripDebug())
.pipe(jsFilter)
.pipe($.stripDebug())
//.pipe($.ngAnnotate())
//.pipe($.uglify({preserveComments: $.uglifySaveLicense}))
//.pipe(jsFilter.restore)
//.pipe(cssFilter)
//.pipe($.csso())
//.pipe(cssFilter.restore)
//.pipe($.revReplace())
//.pipe(htmlFilter)
//.pipe($.minifyHtml({
// empty: true,
// spare: true,
// quotes: true
//}))
//.pipe(htmlFilter.restore)
.pipe(uglify())
.pipe(jsFilter.restore)
.pipe(cssFilter)
.pipe($.csso())
.pipe(cssFilter.restore)
.pipe($.revReplace())
.pipe(htmlFilter)
.pipe($.minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(htmlFilter.restore)
.pipe(gulp.dest('dist'))
.pipe($.size());
......
......@@ -45,7 +45,6 @@
"gulp-rev-replace": "^0.4.4",
"gulp-size": "^3.0.0",
"gulp-strip-debug": "^3.0.0",
"gulp-uglify": "^3.0.0",
"gulp-useref": "^3.1.5",
"http-proxy": "^1.3.0",
"jshint-stylish": "^2.2.1",
......@@ -65,6 +64,7 @@
},
"dependencies": {
"bower": "^1.8.4",
"gulp-debug": "^4.0.0"
"gulp-debug": "^4.0.0",
"gulp-uglify-es": "^1.0.4"
}
}
Markdown is supported
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