fix: dev cmd didn't watch files due to import mangling
Appearently the esModuleInterop flag in TypeScript is not compatible with node-watch, and the import helper was mangling the import as a result and causing an error in the dev command that resulted in files not being watched. This fixes that import issue and adds an e2e test to help prevent a regression of this issue in the future.
This commit is contained in:
parent
af44f1ebf2
commit
b559d5e21a
7 changed files with 200 additions and 5 deletions
|
|
@ -182,8 +182,8 @@ const watchFolders = async (
|
|||
// Try to load node-watch, falling back to fs watch if node-watch isn't
|
||||
// available.
|
||||
try {
|
||||
const { default: watch } = await import("node-watch");
|
||||
watch(folders, { recursive: true }, listener);
|
||||
const nodeWatch = await import("node-watch");
|
||||
nodeWatch.default(folders, { recursive: true }, listener);
|
||||
return;
|
||||
} catch (error) {
|
||||
if (error.code !== "MODULE_NOT_FOUND") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue