forked from fstirlitz/luaparse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (45 loc) · 1.31 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
/* globals require: true */
var gulp = require('gulp')
, header = require('gulp-header')
, uglify = require('gulp-uglify')
, rename = require('gulp-rename')
, jshint = require('gulp-jshint')
, filelog = require('gulp-filelog')
, addsrc = require('gulp-add-src')
, striphtml = require('gulp-striphtml')
, pkg = require('./package.json')
, banner = [
'/*!'
, ' * @license'
, ' * <%= pkg.name %> <%= pkg.version %> <%= pkg.homepage %>'
, ' * Copyright 2012-<%= new Date().getFullYear() %> <%= pkg.author %>'
, ' * MIT license'
, ' */'
, ''
].join('\n');
gulp.task('build', function() {
return gulp.src('luaparse.js')
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
.pipe(uglify({ output: { comments: /^!|@preserve|@license|@cc_on/i } }))
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('dist'));
});
gulp.task('lint', function() {
return gulp.src([
'examples/**/*.html'
, 'docs/!(coverage)/*.html'
])
.pipe(striphtml())
.pipe(addsrc([
'./*.{js,json}'
, './test/{,spec}/*.js'
, './{examples,benchmarks}/**/*.{js,json}'
, '{bin,scripts}/*'
, '.{bowerrc,jshintrc}'
]))
.pipe(filelog())
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});