@@ -17,21 +17,14 @@ import { babelPluginTransformImport } from './babel-plugin-transfer-import';
1717import { PackageInfo } from './define' ;
1818import { runWebpack } from './webpack' ;
1919
20- function getGulpByWatch ( watch : boolean , filesPath : string ) {
20+ function getGulpByWatch ( watch : boolean , filesPath : string | string [ ] ) {
2121 if ( watch ) {
2222 return gulpWatch ( filesPath ) ;
2323 }
2424 /** 文件匹配 */
2525 return gulp . src ( filesPath ) ;
2626}
2727
28- function getCssByWatch ( watch : boolean , filesPath : Array < any > ) {
29- if ( watch ) {
30- return gulpWatch ( filesPath ) ;
31- }
32- /** 文件匹配 */
33- return gulp . src ( filesPath ) ;
34- }
3528const buildTs = ( watch : boolean , outdir : string , babelOptions : any , wholeProject : boolean , sourcePath : string ) => {
3629 const targetPath = wholeProject
3730 ? path . join ( pri . projectRootPath , '{src,packages}/**/*.{ts,tsx}' )
@@ -67,7 +60,7 @@ const buildSassAndLess = (watch: boolean, outdir: string, wholeProject: boolean,
6760 const targetScssPath = getStyleFilePath ( 'scss' , wholeProject , sourcePath ) ;
6861 const targetLessPath = getStyleFilePath ( 'less' , wholeProject , sourcePath ) ;
6962 return new Promise ( ( resolve , reject ) => {
70- getCssByWatch ( watch , [ targetScssPath , targetLessPath ] )
63+ getGulpByWatch ( watch , [ targetScssPath , targetLessPath ] )
7164 . pipe (
7265 gulpSass ( {
7366 includePaths : path . join ( pri . projectRootPath , 'node_modules' ) ,
0 commit comments