forked from dollarshaveclub/scrolldir
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
39 lines (34 loc) · 988 Bytes
/
gulpfile.js
File metadata and controls
39 lines (34 loc) · 988 Bytes
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
const gulp = require('gulp')
const head = require('gulp-header')
const uglify = require('gulp-uglify')
const rename = require('gulp-rename')
const qunit = require('node-qunit-phantomjs')
const pkg = require('./package.json')
const banner = [
'/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @author <%= pkg.author %>',
' * @license <%= pkg.license %>',
'**/',
'',
].join('\n')
gulp.task('test', () => {
qunit('tests/auto/index.html')
qunit('tests/standard/index.html')
qunit('tests/off/index.html')
})
gulp.task('minify', () => {
gulp.src('dist/scrolldir.js')
.pipe(uglify())
.pipe(head(banner, { pkg }))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('dist/'))
gulp.src('dist/scrolldir.auto.js')
.pipe(uglify())
.pipe(head(banner, { pkg }))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('dist/'))
})
gulp.task('default', ['test', 'minify'])