-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
85 lines (71 loc) · 2.22 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// @codingStandardsIgnoreFile
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var csscomb = require('gulp-csscomb');
var eslint = require('gulp-eslint');
var autoprefixer = require('gulp-autoprefixer');
var merge = require('merge-stream');
var sassOptions = {
outputStyle: 'expanded',
includePaths: [
process.cwd() + '/node_modules',
process.cwd() + '/node_modules/susy/sass'
],
sourceMap: true
};
gulp.task('sass', function () {
var parade = gulp
.src('sass/**/*.{scss,sass}')
.pipe(sourcemaps.init())
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(sourcemaps.write('css'))
.pipe(gulp.dest('css'));
var parade_demo = gulp
.src('modules/parade_demo/sass/**/*.{scss,sass}')
.pipe(sourcemaps.init())
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer({browsers: ['last 10 version', 'ie >= 10']}))
.pipe(sourcemaps.write('modules/parade_demo/css'))
.pipe(gulp.dest('modules/parade_demo/css'));
return merge(parade, parade_demo);
});
// gulp.task('csscomb', function () {
// var parade = gulp
// .src('css/**/*.css')
// .pipe(csscomb())
// .pipe(gulp.dest('css'));
// var parade_demo = gulp
// .src('modules/parade_demo/css/**/*.css')
// .pipe(csscomb())
// .pipe(gulp.dest('modules/parade_demo/css'));
// return merge(parade, parade_demo);
// });
gulp.task('eslint', function () {
var parade = gulp
.src('js/**/*.js')
.pipe(eslint())
.pipe(eslint.format());
var parade_demo = gulp
.src('modules/parade_demo/js/**/*.js')
.pipe(eslint())
.pipe(eslint.format());
return merge(parade, parade_demo);
});
gulp.task('copy:js', function () {
return gulp
.src([
'node_modules/iphone-inline-video/dist/iphone-inline-video.browser.js',
'node_modules/rellax/rellax.min.js',
])
.pipe(gulp.dest('js/lib'));
});
gulp.task('copy', ['copy:js', 'copy:css']);
gulp.task('lint', ['csscomb', 'eslint']);
gulp.task('watch', ['sass'], function () {
gulp.watch('**/sass/**/*.{scss,sass}', ['sass']);
// gulp.watch('**/js/**/*.js', ['eslint']);
});
gulp.task('compile', ['sass']);
gulp.task('default', ['compile']);