forked from zwacky/isoCurrency
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
56 lines (40 loc) · 1022 Bytes
/
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
var gulp = require('gulp');
var pipe = require('multipipe');
var less = require('gulp-less');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');
var rimraf = require('rimraf');
var paths = {
js: ['./src/**/*.js'],
dist: {
js: './dist/'
}
};
/**
* removes css- and js-dist folder.
*/
gulp.task('clean', function() {
rimraf.sync(paths.dist.js);
})
gulp.task('js', function() {
gulp.src(paths.js)
.pipe(concat('isoCurrency.min.js'))
.pipe(uglify())
.pipe(gulp.dest(paths.dist.js));
gulp.src(paths.js)
.pipe(concat('isoCurrency.js'))
.pipe(gulp.dest(paths.dist.js));
});
gulp.task('watch', function() {
gulp.watch(paths.js, ['js', 'dist']);
console.log('watching directory:' + paths.js.join(', '));
});
/**
* optimizes the output in terms of minification and concatenation.
*/
gulp.task('dist', function() {
// add some optimizations (?)
});
gulp.task('build', ['clean', 'js', 'dist']);
gulp.task('default', ['build']);