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() {
65
65
await rm ( dist , { recursive : true , force : true } ) ;
66
66
67
67
// 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 } ) ;
72
69
73
70
if ( isWatch ) {
74
71
chokidar . watch ( src ) . on ( 'all' , ( event , filePath , stats ) => {
75
- if ( stats ?. isDirectory ( ) !== true ) {
72
+ if ( stats ?. isDirectory ( ) !== true && filter ( filePath ) ) {
76
73
const target = path . join ( dist , path . relative ( src , filePath ) ) ;
77
74
78
75
if ( event === 'unlink' ) {
@@ -83,4 +80,8 @@ async function copyDefaultFolder() {
83
80
}
84
81
} ) ;
85
82
}
83
+
84
+ function filter ( filename ) {
85
+ return ! filename . endsWith ( '.spec.ts' ) && ! filename . includes ( '__snapshots__' ) ;
86
+ }
86
87
}
You can’t perform that action at this time.
0 commit comments