forked from dhjddcn/halo-theme-butterfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (42 loc) · 1.14 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
const gulp = require( 'gulp' );
const { src, dest } = require( 'gulp' );
const less = require( 'gulp-less' );
const uglify = require( "gulp-uglify" );
const minifyCSS = require( 'gulp-csso' );
const autoprefix = require( 'gulp-autoprefixer' );
const rename = require( 'gulp-rename' );
const gulpBabel = require( "gulp-babel" );
gulp.task( "css", function () {
return src( './source/css/*.less' )
.pipe( less() )
.pipe( autoprefix( {
overrideBrowserslist: [
"> 2%", "last 2 versions", "not ie 6-9"
],
cascade: false
} ) )
.pipe( minifyCSS() )
.pipe( rename( {
suffix: '.min'
} ) )
.pipe( dest( './source/css/min' ) )
} )
gulp.task( "js", function () {
return src( './source/js/*.js', )
.pipe(
gulpBabel( {
presets: [ '@babel/preset-env' ]
} )
)
.pipe( uglify() )
.pipe( rename( {
extname: '.min.js'
} ) )
.pipe( dest( './source/js/min' ) )
} )
gulp.task(
"default",
gulp.series(
gulp.parallel( "css", "js" )
)
);