forked from g3w-suite/g3w-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (51 loc) · 1.79 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
var gulp = require('gulp'),
useref = require('gulp-useref'),
gulpif = require('gulp-if'),
replace = require('gulp-replace'),
uglify = require('gulp-uglify'),
cleanCss = require('gulp-clean-css'),
flatten = require('gulp-flatten'),
del = require('del');
gulp.task('build', function () {
return gulp.src('g3w-admin/templates/base.html')
.pipe(replace(/"{% static /g,''))
.pipe(replace(/ %}"/g,''))
.pipe(useref({ searchPath: [
'g3w-admin/core/static',
]}))
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.css', cleanCss({
//root: 'g3w-admin/core/static/bower_components/icheck/skins',
//rebase: false,
keepSpecialComments: 0,
inline: ['none']
})))
.pipe(gulp.dest('g3w-admin/core/static/dist'));
});
gulp.task('icheck_png', function () {
return gulp.src(['g3w-admin/core/static/bower_components/icheck/skins/flat/green*.png',
'g3w-admin/core/static/bower_components/icheck/skins/flat/blue*.png'
])
.pipe(flatten())
.pipe(gulp.dest('g3w-admin/core/static/dist/css/'))
});
gulp.task('fonts', function () {
return gulp.src([
'g3w-admin/core/static/bower_components/**/*.{eot,ttf,woff,woff2}',
'g3w-admin/core/static/modules/**/*.{eot,ttf,woff,woff2}'
])
.pipe(flatten())
.pipe(gulp.dest('g3w-admin/core/static/dist/fonts/'))
});
gulp.task('font-summernote', function () {
return gulp.src([
'g3w-admin/core/static/modules/summernote/font/*.{eot,ttf,woff,woff2}'
])
.pipe(flatten())
.pipe(gulp.dest('g3w-admin/core/static/dist/css/font/'))
});
gulp.task('default', ['build', 'icheck_png', 'fonts', 'font-summernote'], function(){
return del([
'g3w-admin/core/static/dist/base.html'
]);
});