-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
59 lines (49 loc) · 1.15 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
'use strict';
var gulp = require('gulp'),
postcss = require('gulp-postcss'),
rigger = require('gulp-rigger'),
autoprefixer = require('autoprefixer'),
sorting = require('postcss-sorting'),
sortingConfig = require('./posrcss-sorting.config.json'),
path = {
build: {
html: '.',
js: 'js/',
css: 'css/',
img: 'images/'
},
src: {
html: 'src/*.html',
js: 'src/js/main.js',
style: 'src/css/styles.css',
img: 'src/images/'
}
};
//TODO: css
gulp.task('styles:build', function () {
var processors = [
autoprefixer,
sorting(sortingConfig)
];
return gulp.src(path.src.style)
.pipe(postcss(processors))
.pipe(gulp.dest(path.build.css));
});
//TODO: html
gulp.task('html:build', function () {
gulp.src(path.src.html)
.pipe(rigger())
.pipe(gulp.dest(path.build.html));
});
//TODO: js
gulp.task('js:build', function() {
gulp.src(path.src.js)
.pipe(gulp.dest(path.build.js));
});
//TODO: build
gulp.task('build', [
'styles:build',
'html:build',
'js:build'
]);
gulp.task('default', ['build']);