-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
52 lines (43 loc) · 1.09 KB
/
Copy pathgulpfile.js
File metadata and controls
52 lines (43 loc) · 1.09 KB
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
var pkg = require('./package.json')
gulp = require('gulp'),
// jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
// fs = require('vinyl-fs'),
header = require('gulp-header'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename'),
clean = require('gulp-clean');
var paths = {
output : 'dist/',
scripts : [
'src/mediani.js'
]
};
var banner = [
'/*! \n',
'<%= package.name %> ',
'v<%= package.version %> \n',
'(c) ' + new Date().getFullYear() + ' <%= package.author %>',
' <%= package.homepage %>',
'\n */',
'\n \n'
].join('');
gulp.task('clean', function () {
return gulp.src(paths.output, { read: false })
.pipe(plumber())
.pipe(clean());
});
gulp.task('scripts', ['clean'], function() {
return gulp.src(paths.scripts)
.pipe(plumber())
.pipe(header(banner, { package : pkg }))
.pipe(gulp.dest('dist/'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(header(banner, { package : pkg }))
.pipe(gulp.dest('dist/'));
});
gulp.task('watch', function() {
gulp.watch('src/*.js', ['scripts']);
});
gulp.task('default', ['scripts']);