@@ -85,11 +85,15 @@ gulp.task('json', () => {
8585
8686gulp . task ( 'html' , [ 'styles' , 'scripts' ] , ( ) => {
8787 var options = JSON . parse ( fs . readFileSync ( './app/config.json' ) ) . dev ;
88+ < % if ( isButton ) { % >
89+ return gulp . src ( [ '.tmp/**/*' ] )
90+ < % } else { % >
8891 return gulp . src ( 'app/*.html' )
8992 . pipe ( $ . useref ( {
9093 searchPath : [ '.tmp' , 'app' , '.' ]
9194 } ) )
92- . pipe ( $ . if ( '*.js' , $ . uglify ( ) ) )
95+ < % } % >
96+ . pipe ( $ . if ( '*.js' , $ . uglify ( ) ) )
9397 . pipe ( $ . if ( '*.css' , $ . cssSandbox ( '#' + options . root ) ) )
9498 . pipe ( $ . if ( '*.css' , $ . cssnano ( ) ) )
9599 // convert relative urls to absolute
@@ -153,7 +157,9 @@ let mockAddinHost = sourceDir => {
153157
154158 if ( parsed . pathname === '/' || parsed . pathname . indexOf ( config . dev . root + '.html' ) > - 1 ) {
155159 if ( isButton ) {
156- htmlSource = fs . readFileSync ( '.dev/button.html' , 'utf8' ) . replace ( '{icon}' , `style="background-image: url(${ config . items [ 0 ] . icon } )"` || '' ) ;
160+ htmlSource = fs . readFileSync ( '.dev/button.html' , 'utf8' )
161+ . replace ( '{click}' , config . items [ 0 ] . click || '' )
162+ . replace ( '{icon}' , `style="background-image: url(${ config . items [ 0 ] . icon } )"` || '' ) ;
157163 } else {
158164 htmlSource = fs . readFileSync ( parsed . pathname === '/' ? `${ sourceDir } /${ config . dev . root } .html` : parsed . pathname , 'utf8' ) ;
159165 }
0 commit comments