@@ -4,15 +4,13 @@ import tsc from 'gulp-typescript'
44import path from 'path'
55import swc from 'gulp-swc'
66import esbuild from 'gulp-esbuild'
7- import watch from 'gulp-watch'
87
98import config from './config'
109
1110const {
1211 srcPath,
1312 esbuildOptions,
1413 swcOptions,
15- bundleInDemoPath,
1614 bundlePath,
1715 typesPath,
1816 tsConfigPath,
@@ -24,14 +22,6 @@ const genTsc = () => {
2422 return tsc . createProject ( tsConfigPath )
2523}
2624
27- gulp . task ( 'clean-dev-bundle' , ( ) => {
28- return gulp . src ( bundleInDemoPath , { allowEmpty : true } ) . pipe ( clean ( ) )
29- } )
30-
31- gulp . task ( 'clean-demo-dev-bundle' , ( ) => {
32- return gulp . src ( bundleInDemoPath , { allowEmpty : true } ) . pipe ( clean ( ) )
33- } )
34-
3525gulp . task ( 'clean-bundle' , ( ) => {
3626 return gulp . src ( bundlePath , { allowEmpty : true } ) . pipe ( clean ( ) )
3727} )
@@ -63,27 +53,17 @@ gulp.task('esbuild-bundle-dev', () => {
6353 . pipe ( gulp . dest ( bundlePath ) )
6454} )
6555
66- gulp . task ( 'copy-2-demo' , ( ) => {
67- return gulp . src ( path . resolve ( swcBuildPath , '*.js' ) ) . pipe ( gulp . dest ( bundleInDemoPath ) )
68- } )
69-
7056gulp . task ( 'watch' , ( ) => {
7157 const tsFile = path . resolve ( srcPath , '*.ts' )
72- const watcher = watch ( tsFile , gulp . series ( 'dev' ) )
73- watcher . on ( 'change' , function ( path , stats ) {
74- console . log ( `File ${ path } was changed` )
75- } )
58+ gulp . watch ( tsFile , undefined , gulp . series ( 'dev' ) )
7659} )
7760
7861// build for develop
7962gulp . task (
8063 'dev' ,
8164 gulp . series (
82- 'clean-dev-bundle' ,
83- 'clean-demo-dev-bundle' ,
8465 'swc-ts-2-js' ,
8566 'esbuild-bundle-dev' ,
86- 'copy-2-demo' ,
8767 ) ,
8868)
8969
0 commit comments