File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed
Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,6 @@ await yargs(hideBin(process.argv))
116116 const closeHandlers : ( ( ) => Promise < void > ) [ ] = [ ] ;
117117 const resolvedDir = path . resolve ( args . dir ) ;
118118
119- await bundleSource ( resolvedDir , logger ) ;
120-
121119 const handleClose = async ( ) : Promise < void > => {
122120 await Promise . all (
123121 closeHandlers . map ( async ( close ) => withTimeout ( close ( ) , 400 ) ) ,
Original file line number Diff line number Diff line change @@ -56,8 +56,9 @@ export const makeWatchEvents = (
5656 error : ( error : Error ) => throwError ( error ) ,
5757} ) ;
5858
59- export const filterOnlyJsFiles : MatchFunction = ( file , stats ) =>
60- ( stats ?. isFile ( ) ?? false ) && file . endsWith ( '.js' ) ;
59+ export const notAJsFile : MatchFunction = ( file , stats ) =>
60+ ( stats ?. isFile ( ) ?? false ) &&
61+ ( file . includes ( 'node_modules' ) || ! file . endsWith ( '.js' ) ) ;
6162
6263/**
6364 * Start a watcher that bundles `.js` files in the target dir.
@@ -77,14 +78,8 @@ export function watchDir(dir: string, logger: Logger): WatchDirReturn {
7778 const { reject : throwError , promise : errorPromise } = makePromiseKit < never > ( ) ;
7879
7980 let watcher = watch ( resolvedDir , {
80- ignoreInitial : true ,
81- ignored : [
82- '**/node_modules/**' ,
83- '**/*.test.js' ,
84- '**/*.test.ts' ,
85- '**/*.bundle' ,
86- filterOnlyJsFiles ,
87- ] ,
81+ ignoreInitial : false ,
82+ ignored : notAJsFile ,
8883 } ) ;
8984
9085 const events = makeWatchEvents ( watcher , readyResolve , throwError , logger ) ;
You can’t perform that action at this time.
0 commit comments