-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
97 lines (80 loc) · 2.58 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const gulp = require('gulp');
const imagemin = require('gulp-imagemin');
const uncss = require('gulp-uncss');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const cleanCSS = require('gulp-clean-css');
const browserSync = require('browser-sync').create();
const zip = require('gulp-zip');
const responsive = require('gulp-responsive');
const load = require('gulp-load-plugins')();
const Pageres = require('pageres');
const htmlmin = require('gulp-htmlmin');
const autoprefixer = require('gulp-autoprefixer');
const runSequence = require('run-sequence');
const components = ['./css/components/fonts.css', './css/components/colors.css', './css/components/flexalign.css', './css/components/buttons.css'];
// MINIFIC-IMGS
gulp.task('build-img', function(){
gulp.src('img/**/*')
.pipe(imagemin())
.pipe(gulp.dest('img/test'));
})
// MINIFIC-IMGS
// UNCSS
gulp.task('un-css', function () {
return gulp.src('css/css.css')
.pipe(uncss({
html: ['./**/*.html'],
js: ['./**/*.js']
}))
.pipe(rename('final.css'))
.pipe(gulp.dest('css/final'))
});
// UNCSS
// TOPTOPTOP
gulp.task('css', function(){
gulp.src('css/*.css')
.pipe(uncss({
html: ['./**/*.html'],
js: ['./**/*.js']
}))
.pipe(cleanCSS({debug: true}, function(details) {
console.log(details.name + ': ' + details.stats.originalSize);
console.log(details.name + ': ' + details.stats.minifiedSize);
}))
.pipe(concat('master.min.css'))
.pipe(gulp.dest('css'));
});
// TOPTOPTOP
// SCREENSHOT
gulp.task('pg', function(){
const pageres = new Pageres({delay: 2})
.src('agenciamonk.github.io/doc/basic/buttons', ['480x320', '1024x768', 'iphone 5s'])
.dest('prints')
.run()
.then(() => console.log('done'));
});
// SCREENSHOT
gulp.task('copile-css', function() {
return gulp.src(components)
.pipe(concat('monk-framework.css'))
.pipe(gulp.dest('./download'));
});
gulp.task('copile-css-min', function() {
return gulp.src(components)
.pipe(concat('monk-framework.min.css'))
.pipe(cleanCSS({debug: true}, function(details) {
console.log(details.name + ': ' + details.stats.originalSize);
console.log(details.name + ': ' + details.stats.minifiedSize);
}))
.pipe(gulp.dest('./download'));
});
gulp.task('zip-css', function(){
gulp.src('./download/*.css')
.pipe(zip('monk-framework.zip'))
.pipe(gulp.dest('./download'))
});
gulp.task('copile', function(callback) {
runSequence('copile-css','copile-css-min', ['zip-css'], callback);
});