forked from microlinkhq/metascraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (40 loc) · 912 Bytes
/
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
'use strict'
const strip = require('gulp-strip-css-comments')
const prefix = require('gulp-autoprefixer')
const cssnano = require('gulp-cssnano')
const uglify = require('gulp-uglify')
const concat = require('gulp-concat')
const gulp = require('gulp')
const src = {
css: ['src/css/style.css'],
js: ['src/js/main.js']
}
const dist = {
path: 'static',
name: {
css: 'style',
js: 'main'
}
}
gulp.task('css', () => {
gulp
.src(src.css)
.pipe(concat(`${dist.name.css}.min.css`))
.pipe(prefix())
.pipe(strip({ all: true }))
.pipe(cssnano())
.pipe(gulp.dest(dist.path))
})
gulp.task('js', () => {
gulp
.src(src.js)
.pipe(concat(`${dist.name.js}.min.js`))
.pipe(uglify())
.pipe(gulp.dest(dist.path))
})
gulp.task('build', ['css', 'js'])
gulp.task('default', () => {
gulp.start(['build'])
gulp.watch(src.css, ['css'])
gulp.watch(src.js, ['js'])
})