From d81c2e3419d30ab2ecf3badbd45bd4970ec6b69d Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Wed, 10 May 2023 21:57:54 +0100 Subject: [PATCH] add pnpm files to watch ignore list (#226) --- .changeset/rotten-ducks-brush.md | 11 +++++++++++ src/index.ts | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 .changeset/rotten-ducks-brush.md diff --git a/.changeset/rotten-ducks-brush.md b/.changeset/rotten-ducks-brush.md new file mode 100644 index 000000000..5506fd735 --- /dev/null +++ b/.changeset/rotten-ducks-brush.md @@ -0,0 +1,11 @@ +--- +'@cloudflare/next-on-pages': patch +--- + +add pnpm files to ignored list for watch mode + +add the following files to the list of files we ignore for watch mode: + +- `pnpm-lock.yaml`: for consistency since all the other lock files are ignored +- `.pnpm-store`: to prevent potential infinite loops (https://github.com/cloudflare/next-on-pages/issues/212) +- `_tmp_*`: to prevent infinite loops, this is needed because pnpm saves/deletes temporary files to get the relative path to its store (https://github.com/pnpm/pnpm/blob/3f85e75dad4f5560a17367e5faad5a387bd47d05/store/store-path/src/index.ts#L41), such files start with `_tmp_` (see: https://github.com/zkochan/packages/blob/f559aef5b63c2477dd72ce156f35d6111af780f6/path-temp/index.js#L6) diff --git a/src/index.ts b/src/index.ts index b4b8e8108..bbdbedab6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,6 +76,9 @@ function setWatchMode(fn: () => void): void { '.wrangler', 'package-lock.json', 'yarn.lock', + 'pnpm-lock.yaml', + '.pnpm-store', + '_tmp_*', ], ignoreInitial: true, }).on('all', fn);