This repository has been archived by the owner on Jun 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (47 loc) · 1.53 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
var gulp = require('gulp');
var pkg = require('./package.json');
var plugins = require("gulp-load-plugins")();
var concat = require('gulp-concat-util');
var options = {
src: "./src/*.js",
dest: "./dist",
jshint: {
reporter: "jshint-stylish",
options: {
"lookup": false,
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"quotmark": "single",
"onevar": false,
"smarttabs": true,
"trailing": true,
"unused": true,
"strict": true,
"node": false,
"predef": ["window", "jQuery"]
}},
"/src./*.js": "",
header: "/*!\n" +
" * " + pkg.name + " by @GuruDigital - http://www.gurudigital.nz\n" +
" * Copyright Guru Digital Media. \n" +
" */\n"
};
gulp.task('default', function () {
return gulp.src(options.src)
.pipe(plugins.jshint(options.jshint.options))
.pipe(plugins.jshint.reporter(options.jshint.reporter))
.pipe(concat('lib.js'))
.pipe(concat.header(options.header))
.pipe(concat.footer('\n// end\n'))
.pipe(gulp.dest(options.dest))
.pipe(plugins.rename({suffix: ".min"}))
.pipe(plugins.uglify({preserveComments: "license"}))
.pipe(plugins.sourcemaps.write(options.dest))
.pipe(gulp.dest(options.dest))
;
});