forked from qor/qor-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
51 lines (41 loc) · 1.14 KB
/
gulpfile.babel.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
'use strict';
import gulp from 'gulp';
import babel from 'gulp-babel';
var plugins = require("gulp-load-plugins")();
function adminTasks() {
var pathto = function (file) {
return ('./public/' + file);
};
var scripts = {
src: pathto('javascripts/*.js'),
dest: pathto('dist')
};
var styles = {
src: pathto('stylesheets/*.scss'),
scss: pathto('stylesheets/**/*.scss'),
dest: pathto('dist')
}
gulp.task('js', function () {
return gulp.src(scripts.src)
.pipe(babel())
.pipe(plugins.concat('app.js'))
.pipe(plugins.uglify())
.pipe(gulp.dest(scripts.dest));
});
gulp.task('sass', function () {
return gulp.src(styles.src)
.pipe(plugins.sass())
.pipe(plugins.csscomb())
.pipe(plugins.cleanCss())
.pipe(gulp.dest(styles.dest));
});
gulp.task('watch', function () {
gulp.watch(scripts.src, ['js']);
gulp.watch(styles.scss, ['sass']);
});
gulp.task('default', ['watch']);
}
// Init
// -----------------------------------------------------------------------------
console.log('Running "qor-example" module task...');
adminTasks();