-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
57 lines (52 loc) · 1.79 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
48
49
50
51
52
53
54
55
56
57
/*!
* bootstrap-alert-wrapper v1.0.0 (http://javatmp.com)
* Bootstrap modal wrapper factory for creating dynamic and nested stacked dialog features.
* Copyright 2018 JavaTMP
* Licensed under MIT (https://github.com/JavaTMP/bootstrap-alert-wrapper/blob/master/LICENSE)
*/
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var del = require('del');
var eslint = require('gulp-eslint');
var header = require('gulp-header');
var pkg = require('./package.json');
var banner = ['/*!',
' * <%= pkg.name %> (http://javatmp.com)',
' * <%= pkg.description %>',
' *',
' * @version <%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @copyright 2018 JavaTMP',
' * @license <%= pkg.license %>',
' */',
''].join('\n');
gulp.task('clean', function () {
return del(['./dist']);
});
gulp.task('dist', ["clean"], function (cb) {
return gulp.src('./js/bootstrap-alert-wrapper.js')
.pipe(eslint({
"env": {"browser": true, "node": true, "jquery": true},
"rules": {
"semi": 2,
"eqeqeq": 1,
"quotes": 0,
"no-trailing-spaces": 1,
"eol-last": 1,
"no-unused-vars": 0,
"no-underscore-dangle": 1,
"no-alert": 1,
"no-lone-blocks": 1
},
"globals": ["jQuery", "$"]
}))
.pipe(eslint.format())
.pipe(uglify({output: {comments: /^!/}}))
.pipe(header(banner, {pkg: pkg}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./dist/'));
});
gulp.task('default', ["dist"], function () {
// place code for your default task here
});