1
- const gulp = require ( ' gulp' ) ;
2
- const htmlmin = require ( ' gulp-htmlmin' ) ;
3
- const htmlclean = require ( ' gulp-htmlclean' ) ;
4
- const version = require ( ' gulp-version-number' ) ;
5
- const terser = require ( ' gulp-terser' ) ;
1
+ const gulp = require ( " gulp" ) ;
2
+ const htmlmin = require ( " gulp-htmlmin" ) ;
3
+ const htmlclean = require ( " gulp-htmlclean" ) ;
4
+ const version = require ( " gulp-version-number" ) ;
5
+ const terser = require ( " gulp-terser" ) ;
6
6
7
7
// Compress js files
8
- gulp . task ( 'js' , function ( ) {
9
- return gulp . src ( [ './public/js/main.js' ] )
10
- . pipe ( terser ( {
11
- compress : true
12
- } ) )
13
- . pipe ( gulp . dest ( './public/js' ) ) ;
8
+ gulp . task ( "js" , function ( ) {
9
+ return gulp
10
+ . src ( [ "./public/js/main.js" ] )
11
+ . pipe (
12
+ terser ( {
13
+ compress : true ,
14
+ } ) ,
15
+ )
16
+ . pipe ( gulp . dest ( "./public/js" ) ) ;
14
17
} ) ;
15
18
16
-
17
19
// Build html files
18
- gulp . task ( 'html' , function ( ) {
19
- return gulp . src ( './public/**/*.html' )
20
- . pipe ( htmlclean ( ) )
21
- . pipe ( htmlmin ( {
22
- removeComments : true ,
23
- minifyJS : true ,
24
- minifyCSS : true ,
25
- minifyURLs : true ,
26
- } ) )
27
- . pipe ( version ( {
28
- 'append' : {
29
- 'key' : '_v' ,
30
- 'cover' : 1 ,
31
- 'to' : [ 'css' , 'js' , 'png' , 'jpg' , 'woff2' ]
32
- }
33
- } ) )
34
- . pipe ( gulp . dest ( './public' ) ) ;
20
+ gulp . task ( "html" , function ( ) {
21
+ return gulp
22
+ . src ( "./public/**/*.html" )
23
+ . pipe ( htmlclean ( ) )
24
+ . pipe (
25
+ htmlmin ( {
26
+ removeComments : true ,
27
+ minifyJS : true ,
28
+ minifyCSS : true ,
29
+ minifyURLs : true ,
30
+ } ) ,
31
+ )
32
+ . pipe (
33
+ version ( {
34
+ append : {
35
+ key : "_v" ,
36
+ cover : 1 ,
37
+ to : [ "css" , "js" , "png" , "jpg" , "woff2" ] ,
38
+ } ,
39
+ } ) ,
40
+ )
41
+ . pipe ( gulp . dest ( "./public" ) ) ;
35
42
} ) ;
36
43
37
- gulp . task ( ' default' , gulp . parallel ( 'js' , ' html' ) ) ;
44
+ gulp . task ( " default" , gulp . parallel ( "js" , " html" ) ) ;
0 commit comments