-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGulpfile.js
More file actions
executable file
·64 lines (58 loc) · 1.9 KB
/
Gulpfile.js
File metadata and controls
executable file
·64 lines (58 loc) · 1.9 KB
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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
changed = require('gulp-changed')
imagemin = require('gulp-imagemin'),
stripDebug = require('gulp-strip-debug'),
minifyCSS = require('gulp-minify-css'),
minifyHTML = require('gulp-minify-html'),
stylus = require('gulp-stylus'),
jsonminify = require('gulp-jsonminify'),
browserify = require('browserify'),
source = require('vinyl-source-stream'),
streamify = require('gulp-streamify'),
nib = require('nib'),
hbsfy = require("hbsfy");
gulp.task('js', function () {
hbsfy.configure({
extensions: ['hbs']
});
browserify('./frontend/js/mddcloud.js')
.transform(hbsfy)
.ignore('jquery.mousewheel')
.ignore('jquery.select2')
.bundle()
.pipe(source('mddcloud.js'))
.pipe(streamify(uglify()))
.pipe(gulp.dest('frontend/public/js'));
});
gulp.task('i18n', function () {
gulp.src('frontend/js/locales/**')
.pipe(jsonminify())
.pipe(gulp.dest('frontend/public/js/locales'));
});
gulp.task('stylus', function () {
gulp.src('frontend/css/mddcloud.styl')
.pipe(stylus({
'include css': true,
use: nib(),
compress : true
}))
.pipe(gulp.dest('frontend/public/css'));
});
gulp.task('images', function () {
gulp.src('frontend/img/**')
.pipe(changed("frontend/public/img"))
.pipe(imagemin())
.pipe(gulp.dest("frontend/public/img"));
gulp.src(['frontend/css/*.gif','frontend/css/*.png'])
.pipe(changed("frontend/public/css"))
.pipe(imagemin())
.pipe(gulp.dest("frontend/public/css"));
});
gulp.task('fonts', function () {
gulp.src('frontend/fonts/**')
.pipe(gulp.dest('frontend/public/fonts'));
gulp.src('frontend/js/libs/font-awesome-stylus/fonts/**')
.pipe(gulp.dest('frontend/public/fonts'));
});
gulp.task('default', [ 'js','i18n','stylus','images','fonts']);