Skip to content

Commit 461af28

Browse files
committed
build: optional chokidar dependency
1 parent cc402c7 commit 461af28

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
},
3535
"dependencies": {
3636
"anymatch": "^3.1.3",
37-
"chokidar": "^4.0.3",
3837
"destr": "^2.0.5",
3938
"lru-cache": "^11.2.2",
4039
"node-fetch-native": "^1.6.7",
@@ -69,6 +68,7 @@
6968
"azurite": "^3.35.0",
7069
"better-sqlite3": "^12.2.0",
7170
"changelogen": "^0.6.2",
71+
"chokidar": "^4.0.3",
7272
"citty": "^0.1.6",
7373
"db0": "^0.3.2",
7474
"eslint": "^9.35.0",
@@ -109,6 +109,7 @@
109109
"@vercel/functions": "^2.2.12 || ^3.0.0",
110110
"@vercel/kv": "^1.0.1",
111111
"aws4fetch": "^1.0.20",
112+
"chokidar": "^4.0.3",
112113
"db0": ">=0.2.1",
113114
"idb-keyval": "^6.2.1",
114115
"ioredis": "^5.4.2",
@@ -161,6 +162,9 @@
161162
"aws4fetch": {
162163
"optional": true
163164
},
165+
"chokidar": {
166+
"optional": true
167+
},
164168
"db0": {
165169
"optional": true
166170
},

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/drivers/fs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { existsSync, promises as fsp, Stats } from "node:fs";
22
import { resolve, relative, join } from "node:path";
3-
import { FSWatcher, type ChokidarOptions, watch } from "chokidar";
3+
import type { FSWatcher, ChokidarOptions } from "chokidar";
44
import anymatch from "anymatch";
55
import {
66
createError,
@@ -113,6 +113,7 @@ export default defineDriver((userOptions: FSStorageOptions = {}) => {
113113
if (_watcher) {
114114
return _unwatch;
115115
}
116+
const { watch } = await import("chokidar");
116117
await new Promise<void>((resolve, reject) => {
117118
const watchOptions: ChokidarOptions = {
118119
ignoreInitial: true,
@@ -126,7 +127,6 @@ export default defineDriver((userOptions: FSStorageOptions = {}) => {
126127
watchOptions.ignored = [watchOptions.ignored];
127128
}
128129
watchOptions.ignored.push(ignore);
129-
130130
_watcher = watch(base, watchOptions)
131131
.on("ready", () => {
132132
resolve();

0 commit comments

Comments
 (0)