Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
fix phil bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-yx committed Apr 16, 2019
1 parent 3ed5438 commit dd092bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions src/utils/serve-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ function createHandler(dir) {
delete require.cache[require.resolve(fn.functionPath)];
module.paths = before;
};
fn.watcher = chokidar.watch(
[fn.functionPath, path.join(fn.moduleDir, "package.json")],
{
ignored: /node_modules/
}
);
const pathsToWatch = [fn.functionPath];
if (fn.moduleDir) {
pathsToWatch.push(path.join(fn.moduleDir, "package.json"));
}
fn.watcher = chokidar.watch(pathsToWatch, {
ignored: /node_modules/
});
fn.watcher
.on("add", clearCache)
.on("change", clearCache)
Expand Down

1 comment on commit dd092bd

@swyxio
Copy link
Contributor

@swyxio swyxio commented on dd092bd Apr 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a more comprehensive fix might be ported over from here netlify/zip-it-and-ship-it#18

Please sign in to comment.