forked from umlsynco/snippetor-marionette-gulp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (45 loc) · 1.14 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
var gulp = require('gulp'),
imagemin = require('gulp-imagemin'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
pngcrush = require('imagemin-pngcrush'),
rjs = require('gulp-requirejs');
//Compress Images
gulp.task('images', function() {
gulp.src('public/img-src/**/*')
.pipe(imagemin({
progressive : true,
optimizationLevel : 5
}))
.pipe(gulp.dest('public/img'));
});
//Lint JS
gulp.task('lint', function() {
gulp.src(['public/js/app/**/*.js', '!public/js/app/**/*min.js'])
.pipe(jshint());
});
gulp.task('rjs', function() {
//run r.js
rjs({
baseUrl : "public/js/app",
paths : {
"app" : "config/Init"
},
findNestedDependencies : true,
wrap: false,
name: "../libs/almond/almond",
preserveLicenseComments: false,
removeCombined: true,
optimize: "uglify2",
mainConfigFile: "public/js/app/config/Init.js",
include: ["app"],
out: "public/js/app/config/Init.min.js"
})
.pipe(uglify())
.pipe(gulp.dest('./'));
});
//run site build
gulp.task('dist', ['rjs', 'images', 'lint']);
//default for gulp command
gulp.task('default', ['dist']);