forked from elivz/vz_url
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
74 lines (56 loc) · 1.76 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//***********************************************
// SETTINGS
//***********************************************
// File paths
var root = 'ee3/vz_url/';
// Options for AutoPrefixer
var autoprefixerOpts = [
'last 2 versions',
'> 1%',
'ie >= 8'
];
//***********************************************
// SET UP GULP
//***********************************************
// Include Gulp & Tools We'll Use
var gulp = require('gulp');
//***********************************************
// STYLES
//***********************************************
var autoprefixer = require('gulp-autoprefixer');
var minify = require('gulp-minify-css');
var sass = require('gulp-sass');
gulp.task('styles', function() {
return gulp.src('src/*.scss')
.pipe(sass())
.pipe(autoprefixer({ browsers: autoprefixerOpts, sourceMap: false }))
.pipe(minify({compatibility: 'ie8'}))
.pipe(gulp.dest(root+'css'));
});
//***********************************************
// JAVASCRIPT
//***********************************************
var babel = require('gulp-babel');
var eslint = require('gulp-eslint');
var uglify = require('gulp-uglify');
gulp.task('scripts', function() {
return gulp.src('src/*.js')
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest(root+'javascript'));
});
//***********************************************
// WATCH FOR CHANGES
//***********************************************
// Watch Files For Changes & Reload
gulp.task('watch', function() {
gulp.watch(['src/*.scss'], ['styles']);
gulp.watch(['src/*.js'], ['scripts']);
});
//***********************************************
// DEFAULT
//***********************************************
// Default Task
gulp.task('default', function() {
gulp.start('styles', 'scripts');
});