-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (42 loc) · 959 Bytes
/
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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var header = require('gulp-header');
var notify = require("gulp-notify");
var js =
[
'src/bat.log.js',
'src/bat.url.js',
'src/bat.keep.js',
'src/bat.cookie.js',
'src/bat.ajax.js',
'src/bat.md5.js',
'src/bat.timer.js',
'src/bat.scroll.js'
];
var pkg = require('./package.json');
var jsInfo =
[
'/*!',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @author <%= pkg.author %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.url %>',
' * @license <%= pkg.license %>',
' */',
'',
''
].join('\n');
gulp.task('scripts', function()
{
return gulp.src(js)
.pipe(concat('bat.js'))
.pipe(uglify())
.pipe(header(jsInfo, { pkg: pkg }))
.pipe(gulp.dest('dist'))
.pipe(notify('Main bat.js file was created.'));
});
gulp.task('default', function ()
{
gulp.watch(js, ['scripts']);
});