-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
46 lines (41 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
var concat = require('gulp-concat'),
changed = require('gulp-changed'),
gulp = require('gulp'),
header = require('gulp-header'),
imports = require('gulp-imports'),
notify = require("gulp-notify"),
plumber = require('gulp-plumber'),
pkg = require('./package.json'),
sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify');
var js = [ 'source/*.js' ];
var devInfo =
[
'/*!',
' * <%= 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(plumber())
.pipe(imports())
.pipe(changed('dist'))
.pipe(sourcemaps.init())
.pipe(header(devInfo, { pkg: pkg }))
.pipe(concat('longdash.js'))
.pipe(uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
.pipe(notify({ message: 'Longdash: Build', onLast: true }));
});
gulp.task('default', function ()
{
gulp.watch(js, ['scripts']);
});