-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (42 loc) · 1.36 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
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var sass = require('gulp-sass');
var wiredep = require('gulp-wiredep');
var webpack = require('webpack-stream');
var eslint = require('gulp-eslint');
var scsslint = require('gulp-scss-lint');
gulp.task('es-lint', function() {
return gulp.src('src/app/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('scss-lint', function() {
return gulp.src('src/sass/**/*.scss')
.pipe(scsslint())
.pipe(scsslint.failReporter());
});
gulp.task('transpile', ['es-lint'], function() {
return gulp.src('src/app/app.js')
.pipe(webpack(require('./webpack.config.js')))
.pipe(gulp.dest('dist/app/'));
});
gulp.task('scss', ['scss-lint'], () => {
return gulp.src('./src/sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./dist/css'));
});
gulp.task('wiredep', () => {
return gulp.src('./src/templates/**/*.html')
.pipe(wiredep({
ignorePath: '../../dist/'
}))
.pipe(gulp.dest('./dist'))
});
gulp.task('watch', ['transpile', 'wiredep', 'scss'], () => {
gulp.watch('src/app/**/*.js', ['transpile']);
gulp.watch('src/templates/**/*.html', ['wiredep']);
gulp.watch('src/sass/**/*.scss', ['scss']);
});