forked from alenaksu/mdPickers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
44 lines (38 loc) · 1.34 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
"use strict";
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
less = require('gulp-less'),
rename = require('gulp-rename'),
minify = require('gulp-cssnano'),
sourcemaps = require('gulp-sourcemaps'),
wrap = require('gulp-wrap'),
concat = require('gulp-concat'),
autoprefixer = require('gulp-autoprefixer'),
path = require('path');
var outputFolder = 'dist/';
var moduleName = 'mdPickers';
gulp.task('assets', function() {
return gulp.src(['src/core/**/*.less', 'src/components/**/*.less'])
.pipe(concat('mdPickers.less'))
.pipe(less())
.pipe(autoprefixer())
.pipe(gulp.dest(outputFolder))
.pipe(rename({suffix: '.min'}))
.pipe(minify())
.pipe(gulp.dest(outputFolder));
});
gulp.task('build-app', function() {
return gulp.src(['src/mdPickers.js', 'src/core/**/*.js', 'src/components/**/*.js'])
.pipe(concat('mdPickers.js'))
.pipe(wrap('(function() {\n"use strict";\n<%= contents %>\n})();'))
.pipe(sourcemaps.init())
.pipe(gulp.dest(outputFolder))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(outputFolder));
});
gulp.task('watch', function() {
gulp.watch('src/**/*', ['assets', 'build-app']);
});
gulp.task('default', ['assets', 'build-app']);