-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgulpfile.js
67 lines (57 loc) · 1.44 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
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var babel = require('gulp-babel');
var sass = require('gulp-sass');
var cssnano = require('gulp-cssnano');
var uglify = require('gulp-uglify');
var paths = {
app: 'app/',
css: 'app/static/css',
font: 'app/static/fonts'
};
var tasks = [
'js',
'sass',
'normalize',
'highlightstyles',
'fontstyles',
'fontfiles'
];
gulp.task('js', function() {
gulp.src('src/**/*.js')
.pipe(plumber())
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest(paths.app))
});
gulp.task('sass', function() {
gulp.src('sass/main.scss')
.pipe(plumber())
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(gulp.dest(paths.css));
});
gulp.task('normalize', function() {
gulp.src('node_modules/normalize.css/normalize.css')
.pipe(cssnano())
.pipe(gulp.dest(paths.css));
});
gulp.task('highlightstyles', function() {
gulp.src('node_modules/highlight.js/styles/monokai-sublime.css')
.pipe(cssnano())
.pipe(gulp.dest(paths.css));
});
gulp.task('fontstyles', function() {
gulp.src('node_modules/font-awesome/css/font-awesome.min.css')
.pipe(gulp.dest(paths.css));
});
gulp.task('fontfiles', function() {
gulp.src('node_modules/font-awesome/fonts/*.*')
.pipe(gulp.dest(paths.font));
});
gulp.task('default', tasks, function() {
gulp.watch(['src/**/*.js'], ['js']);
gulp.watch(['sass/**/*.scss'], ['sass']);
});
gulp.task('compile', tasks);