-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (38 loc) · 928 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
/*JS VARIABLES*/
const gulp = require('gulp');
const babel = require('gulp-babel');
const sass = require('gulp-sass');
const rename = require('gulp-rename');
/* PATH VARIABLES */
//JS
var jsSrc = 'wpss.js';
var jsDist = './';
var scssSrc = 'demo/*.scss';
var cssDist = 'demo/';
/*
Use next generation JavaScript, today.
========================================
*/
gulp.task('babel', () => {
return gulp.src(jsSrc)
.pipe(babel({
presets: ['es2015']
}))
.pipe(rename({extname : '.legacy.js'}))
.pipe(gulp.dest(jsDist));
});
gulp.task('styles',() => {
return gulp.src(scssSrc)
.pipe(sass({outputStyle:'compressed'}).on('error',sass.logError))
.pipe(gulp.dest(cssDist));
});
/*
WATCH
=====
*/
gulp.task('js-watch', ['babel']);
gulp.task('css-watch', ['styles']);
gulp.task('watch', function() {
gulp.watch(jsSrc, ['js-watch']);
gulp.watch(scssSrc,['css-watch']);
});