This repository has been archived by the owner on Jul 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathgulpfile.js
44 lines (43 loc) · 1.43 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
var gulp = require('gulp'),
umd = require('gulp-umd'),
concat = require('gulp-concat'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
stylish = require('jshint-stylish'),
header = require('gulp-header'),
rename = require('gulp-rename'),
package = require('./package.json'),
size = require('gulp-size'),
banner = [
'/*!',
' * Salvattore <%= pkg.version %> by @rnmp and @ppold',
' * <%= pkg.repository.url %>',
' */\n'
].join('\n');
gulp.task('default', function() {
return gulp.src(['src/polyfills/matchMedia.js',
'src/polyfills/matchMedia.addListener.js',
'src/polyfills/requestAnimationFrame.js',
'src/polyfills/customEvent.js',
'src/*.js'])
.pipe(jshint({
laxcomma: true,
strict: true
}))
.pipe(jshint.reporter(stylish))
.pipe(concat(package.name + '.js'))
.pipe(umd({
exports: function(file) {
return package.name;
},
namespace: function(file) {
return package.name;
}
}))
.pipe(header(banner, {pkg: package}))
.pipe(gulp.dest('dist/'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(rename({suffix: '.min'}))
.pipe(size({showFiles: true, gzip: true}))
.pipe(gulp.dest('dist/'));
});