@@ -308,61 +308,54 @@ function publish(tagString, done) {
308308}
309309
310310function pub ( done ) {
311- dist ( code => {
312- if ( code ) {
313- done ( code ) ;
314- return ;
315- }
316- const notOk = ! packageJson . version . match ( / ^ \d + \. \d + \. \d + $ / ) ;
317- let tagString ;
318- if ( argv [ 'npm-tag' ] ) {
319- tagString = argv [ 'npm-tag' ] ;
320- }
321- if ( ! tagString && notOk ) {
322- tagString = 'next' ;
323- }
324- if ( packageJson . scripts [ 'pre-publish' ] ) {
325- runCmd ( 'npm' , [ 'run' , 'pre-publish' ] , code2 => {
326- if ( code2 ) {
327- done ( code2 ) ;
328- return ;
329- }
330- publish ( tagString , done ) ;
331- } ) ;
332- } else {
311+ const notOk = ! packageJson . version . match ( / ^ \d + \. \d + \. \d + $ / ) ;
312+ let tagString ;
313+ if ( argv [ 'npm-tag' ] ) {
314+ tagString = argv [ 'npm-tag' ] ;
315+ }
316+ if ( ! tagString && notOk ) {
317+ tagString = 'next' ;
318+ }
319+ if ( packageJson . scripts [ 'pre-publish' ] ) {
320+ runCmd ( 'npm' , [ 'run' , 'pre-publish' ] , code2 => {
321+ if ( code2 ) {
322+ done ( code2 ) ;
323+ return ;
324+ }
333325 publish ( tagString , done ) ;
334- }
335- } ) ;
326+ } ) ;
327+ } else {
328+ publish ( tagString , done ) ;
329+ }
336330}
337331
338- gulp . task (
339- 'compile-with-es' ,
340- gulp . series ( done => {
341- compile ( false ) . on ( 'finish' , function ( ) {
342- done ( ) ;
343- } ) ;
344- } ) ,
345- ) ;
332+ gulp . task ( 'compile-with-es' , done => {
333+ console . log ( '[Parallel] Compile to es...' ) ;
334+ compile ( false ) . on ( 'finish' , done ) ;
335+ } ) ;
336+
337+ gulp . task ( 'compile-with-lib' , done => {
338+ console . log ( '[Parallel] Compile to js...' ) ;
339+ compile ( ) . on ( 'finish' , done ) ;
340+ } ) ;
346341
347342gulp . task (
348343 'compile' ,
349- gulp . series ( 'compile-with-es' , done => {
350- compile ( ) . on ( 'finish' , function ( ) {
351- done ( ) ;
352- } ) ;
344+ gulp . series ( gulp . parallel ( 'compile-with-es' , 'compile-with-lib' ) , done => {
345+ done ( ) ;
353346 } ) ,
354347) ;
355348
356349gulp . task (
357350 'dist' ,
358- gulp . series ( 'compile' , done => {
351+ gulp . series ( done => {
359352 dist ( done ) ;
360353 } ) ,
361354) ;
362355
363356gulp . task (
364357 'pub' ,
365- gulp . series ( 'check-git' , 'compile' , done => {
358+ gulp . series ( 'check-git' , 'compile' , 'dist' , done => {
366359 // if (!process.env.GITHUB_TOKEN) {
367360 // console.log('no GitHub token found, skip');
368361 // } else {
0 commit comments