forked from CreativeIT/getmdl-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (36 loc) · 1012 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
'use strict';
var gulp = require('gulp'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
sassFiles = ['./src/scss/**/*.scss'],
uglify = require('gulp-uglifyjs'),
jsFiles = ['src/js/**/*.js'],
babel = require('gulp-babel');
gulp.task('sass', function () {
gulp
.src(sassFiles)
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(rename(function(path) {
path.dirname = '';
path.basename = 'getmdl-select';
path.extname = '.min.css';
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./'));
});
gulp.task('js', function() {
gulp
.src(jsFiles)
.pipe(babel())
.pipe(uglify('getmdl-select.min.js', {
outSourceMap: true
}))
.pipe(gulp.dest('./'));
});
gulp.task('watch', function () {
gulp.watch(sassFiles, ['sass']);
gulp.watch(jsFiles, ['js']);
});
gulp.task('default', ['sass', 'js'], function(){});