-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (53 loc) · 1.5 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
const gulp = require( 'gulp' );
// エラーでも監視を続行させる
const plumber = require( 'gulp-plumber' );
const sass = require( 'gulp-sass' )( require( 'sass' ) );
// add vender prifix
const autoprefixer = require( 'gulp-autoprefixer' );
const cleanCss = require( 'gulp-clean-css' );
const replace = require( 'gulp-replace' );
gulp.task( 'build_css', function ( done ) {
gulp.src( [ './inc/filter-search/package/src/style.scss' ] )
.pipe(
plumber( {
handleError: ( err ) => {
console.log( err ); //eslint-disable-line no-console
this.emit( 'end' );
},
} )
)
.pipe( plumber() )
.pipe(
sass( {
includePaths: [ './inc/filter-search/package/src/style.scss' ],
} )
)
.pipe( autoprefixer() )
.pipe( cleanCss() )
.pipe( gulp.dest( './inc/filter-search/package/build/' ) );
gulp.src( [ './inc/filter-search/package/src/editor.scss' ] )
.pipe(
plumber( {
handleError: ( err ) => {
console.log( err ); //eslint-disable-line no-console
this.emit( 'end' );
},
} )
)
.pipe( plumber() )
.pipe(
sass( {
includePaths: [ './inc/filter-search/package/src/editor.scss' ],
} )
)
.pipe( autoprefixer() )
.pipe( cleanCss() )
.pipe( gulp.dest( './inc/filter-search/package/build/' ) );
done();
} );
gulp.task( 'replace_text_domain', function ( done ) {
gulp.src( [ './inc/filter-search/package/**' ] )
.pipe( replace( "'vk-filter-search-pro'", "'vk-filter-search'" ) )
.pipe( gulp.dest( './inc/filter-search/package/' ) );
done();
} );