-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (40 loc) · 1.36 KB
/
gulpfile.js
File metadata and controls
49 lines (40 loc) · 1.36 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
var gulp = require('gulp'),
del = require('del'),
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
minifyCSS = require('gulp-csso'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
uglify = require('gulp-uglify');
var paths = {
build: 'build/',
scripts: 'source/**/*.js',
styles: 'source/**/*.scss'
};
gulp.task('clean', function() {
return del(['build']);
});
// TODO: Exclude locales.
gulp.task('scripts', function() {
return gulp.src(paths.scripts)
.pipe(concat('assistant.js'))
.pipe(gulp.dest(paths.build))
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(paths.build));
});
gulp.task('styles', function() {
return gulp.src(paths.styles)
.pipe(sass({ outputStyle: 'expanded' }).on('error', sass.logError))
.pipe(autoprefixer('last 3 version'))
.pipe(gulp.dest(paths.build))
.pipe(minifyCSS())
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest(paths.build));
});
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.styles, ['styles']);
});
gulp.task('default', ['watch', 'scripts', 'styles']);
gulp.task('release', ['scripts', 'styles']);