forked from locomotivemtl/locomotive-scroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.js
41 lines (37 loc) · 1.12 KB
/
styles.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
import gulp from 'gulp';
import sass from 'gulp-sass';
import autoprefixer from 'gulp-autoprefixer';
import header from 'gulp-header';
import merge from 'merge-stream';
import paths from '../mconfig.json';
import pkg from '../package.json';
import error from './error.js';
import { server } from './serve.js';
function styles() {
const files = [
{
src: paths.styles.src,
dest: paths.styles.dest
},
{
src: paths.styles.docs.src,
dest: paths.styles.docs.dest
}
];
const streams = files.map((file) => {
return gulp
.src(file.src + '**/*.scss')
.pipe(sass())
.on('error', function(err) {
error(this, err, 'stack');
})
.pipe(autoprefixer({
cascade: false
}))
.pipe(header('/*! locomotive-scroll v' + pkg.version + ' | MIT License | https://github.com/locomotivemtl/locomotive-scroll */\n'))
.pipe(gulp.dest(file.dest))
.pipe(server.stream());
});
return merge(streams);
}
export default styles;