forked from illuminate3/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
59 lines (52 loc) · 2.06 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
// Requis
var gulp = require('gulp');
//Plugins
var //rename = require('gulp-rename'),
//uglify = require('gulp-uglify'),
plumber = require('gulp-plumber'),
csscomb = require('gulp-csscomb'),
cssbeautify = require('gulp-cssbeautify'),
//autoprefixer = require('autoprefixer'),
license = require('gulp-header'),
fs = require('fs'),
beautifier = require('gulp-jsbeautifier'),
gulpignore = require('gulp-ignore');
//-----------------------//
// Task css = CSScomb style formatter + beautify-css (reindent and reformat css) + autoprefixer prefix css (source -> destination)
gulp.task('css', function() {
return gulp.src(['./**/*.css', '!./node_modules/**', '!./tmp/**', '!./app/common/**','!./**/*.min.js','!./**/*.min.css'])
.pipe(plumber({}))
//.pipe(csscomb())
.pipe(cssbeautify({
indent: ' ',
openbrace: 'separate-line',
autosemicolon: true
}))
//.pipe(autoprefixer())
.pipe(gulp.dest('./dist'));
});
//Header on file JS & CSS
gulp.task('license', function() {
var year = (new Date()).getFullYear();
gulp.src(['./**/*.js','!./**/*.min.js','!./node_modules/**', '!./tmp/**', '!./app/common/**'])
.pipe(license(fs.readFileSync('header.md', 'utf8'), {
year: year
}, 0.9))
.pipe(gulp.dest('.'));
});
//Clean indentation Js, css, html
gulp.task('beautifier', function() {
gulp.src(['./**/*.css', './**/*.html', './**/*.js','!./node_modules/**','!/tmp/**','!./**/*.min.js','!./**/*.min.css']) //['./**/*.css', './**/*.html', './**/*.js','!./node_modules/**','!/tmp/**']
.pipe(beautifier({
"indent_size": 4,
"indent_char": ' ',
// other options
"js": {
// other options
"indent_size": 3
}
}))
.pipe(gulp.dest('./'));
});
// Task default
gulp.task('default', ['license']);