diff --git a/dist/functions/server/watcher-esbuild-ctx.js b/dist/functions/server/watcher-esbuild-ctx.js index 027ea72..b92eaee 100644 --- a/dist/functions/server/watcher-esbuild-ctx.js +++ b/dist/functions/server/watcher-esbuild-ctx.js @@ -10,6 +10,8 @@ export default async function watcherEsbuildCTX() { recursive: true, persistent: true, }, async (event, filename) => { + // log.info(`event: ${event}`); + // log.info(`filename: ${filename}`); if (!filename) return; if (filename.match(/^\.\w+/)) { @@ -71,7 +73,9 @@ export default async function watcherEsbuildCTX() { ? "Sylesheet" : file_stat?.isDirectory() ? "Directory" - : "Page"; + : filename.match(/\/pages\/api\//) + ? "API Route" + : "Page"; await fullRebuild({ msg: `${type} ${action}: ${filename}. Rebuilding ...`, }); diff --git a/package.json b/package.json index 80b5a79..8e5920a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@moduletrace/bunext", "module": "index.ts", "type": "module", - "version": "1.0.49", + "version": "1.0.50", "main": "dist/index.js", "types": "dist/index.d.ts", "exports": { diff --git a/src/functions/server/watcher-esbuild-ctx.ts b/src/functions/server/watcher-esbuild-ctx.ts index 9d993ec..9503e1c 100644 --- a/src/functions/server/watcher-esbuild-ctx.ts +++ b/src/functions/server/watcher-esbuild-ctx.ts @@ -15,6 +15,9 @@ export default async function watcherEsbuildCTX() { persistent: true, }, async (event, filename) => { + // log.info(`event: ${event}`); + // log.info(`filename: ${filename}`); + if (!filename) return; if (filename.match(/^\.\w+/)) { @@ -92,7 +95,9 @@ export default async function watcherEsbuildCTX() { ? "Sylesheet" : file_stat?.isDirectory() ? "Directory" - : "Page"; + : filename.match(/\/pages\/api\//) + ? "API Route" + : "Page"; await fullRebuild({ msg: `${type} ${action}: ${filename}. Rebuilding ...`,