-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (31 loc) · 876 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
const gulp = require('gulp');
const autoprefixer = require('gulp-autoprefixer');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const css = require('gulp-uglifycss');
const htmlmin = require('gulp-htmlmin')
function html() {
return gulp.src('./dest/index.html')
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(gulp.dest('./'))
}
function adicionar() {
return gulp.src('./style/style.css')
.pipe(css())
.pipe(autoprefixer({
cascade: false,
browsers: ['last 2 versions']
}))
.pipe(gulp.dest('style/'))
}
function arquivo() {
return gulp.src('./webpack/*.js')
.pipe(babel({
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(gulp.dest('./'))
}
gulp.task('a', adicionar);
gulp.task('c', arquivo)
gulp.task('h', html)