forked from k0kubun/Nocturn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (54 loc) · 1.26 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
const gulp = require('gulp');
const babel = require('gulp-babel');
const bower = require('gulp-bower');
const sass = require('gulp-sass');
gulp.task('bower', () => {
return bower().pipe(gulp.dest('./bower_components'));
});
gulp.task('compile-fonts', () => {
return gulp.
src('./bower_components/font-awesome/fonts/**.*').
pipe(gulp.dest('fonts'));
});
gulp.task(
'compile',
[
'compile-es6',
'compile-html',
'compile-scss',
]
);
gulp.task('compile-es6', () => {
return gulp.
src('src/**/*.js').
pipe(
babel({
presets: ['es2015', 'react'],
plugins: [
'syntax-trailing-function-commas',
'transform-class-properties',
'transform-inline-environment-variables',
'transform-object-rest-spread',
],
})
).
pipe(gulp.dest('app'));
});
gulp.task('compile-html', () => {
return gulp.
src('src/**/*.html').
pipe(gulp.dest('app'));
});
gulp.task('compile-scss', () => {
return gulp.
src('src/**/*.scss').
pipe(
sass({
includePaths: [
'./bower_components/bootstrap-sass/assets/stylesheets',
'./bower_components/font-awesome/scss',
],
}).on('error', sass.logError)
).
pipe(gulp.dest('app'));
});