File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,11 @@ async function copyDefaultFolder() {
6565 await rm ( dist , { recursive : true , force : true } ) ;
6666
6767 // copy default folder unmodified, without test files
68- await cp ( src , dist , {
69- recursive : true ,
70- filter : ( filename ) => ! filename . endsWith ( '.spec.ts' ) && ! filename . includes ( '__snapshots__' ) ,
71- } ) ;
68+ await cp ( src , dist , { recursive : true , filter } ) ;
7269
7370 if ( isWatch ) {
7471 chokidar . watch ( src ) . on ( 'all' , ( event , filePath , stats ) => {
75- if ( stats ?. isDirectory ( ) !== true ) {
72+ if ( stats ?. isDirectory ( ) !== true && filter ( filePath ) ) {
7673 const target = path . join ( dist , path . relative ( src , filePath ) ) ;
7774
7875 if ( event === 'unlink' ) {
@@ -83,4 +80,8 @@ async function copyDefaultFolder() {
8380 }
8481 } ) ;
8582 }
83+
84+ function filter ( filename ) {
85+ return ! filename . endsWith ( '.spec.ts' ) && ! filename . includes ( '__snapshots__' ) ;
86+ }
8687}
You can’t perform that action at this time.
0 commit comments