File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/zenn-cli/cli/preview Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,12 @@ export const exec: cliCommand = async (argv) => {
2828 const srcDir = `${ __dirname } /../../../.` ; // refer ".next" dir from dist/cli/preview/index.js
2929 const server = await build ( { port, previewUrl, srcDir } ) ;
3030 if ( watch ) {
31- const watcher = chokidar . watch ( process . cwd ( ) ) ;
31+ const watcher = chokidar . watch ( ` ${ process . cwd ( ) } /{articles,books}/**/*` ) ;
3232 const io = socketIo ( server ) ;
33- watcher . once ( "ready" , ( ) => {
33+ watcher . on ( "ready" , ( ) => {
3434 io . on ( "connection" , ( socket ) => {
35- watcher . once ( "all" , async ( _ , path ) => {
36- if ( / a r t i c l e s | b o o k s / . test ( path ) ) {
37- socket . emit ( "reload" ) ;
38- }
35+ watcher . once ( "all" , async ( ) => {
36+ socket . emit ( "reload" ) ;
3937 } ) ;
4038 } ) ;
4139 } ) ;
You can’t perform that action at this time.
0 commit comments