Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 1d4e6fc

Browse files
authored
Add support for wrangler.jsonc (#455)
1 parent f08b855 commit 1d4e6fc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.changeset/nine-days-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/cloudflare': minor
3+
---
4+
5+
Adds `wrangler.jsonc` to the default watched config files. If a config file is specified in `platformProxy.configPath`, that file location is watched instead of the defaults.

packages/cloudflare/src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,13 @@ export default function createIntegration(args?: Options): AstroIntegration {
131131
integrations: [astroWhen()],
132132
image: setImageConfig(args?.imageService ?? 'compile', config.image, command, logger),
133133
});
134-
addWatchFile(new URL('./wrangler.toml', config.root));
135-
addWatchFile(new URL('./wrangler.json', config.root));
134+
if (args?.platformProxy?.configPath) {
135+
addWatchFile(new URL(args.platformProxy.configPath, config.root));
136+
} else {
137+
addWatchFile(new URL('./wrangler.toml', config.root));
138+
addWatchFile(new URL('./wrangler.json', config.root));
139+
addWatchFile(new URL('./wrangler.jsonc', config.root));
140+
}
136141
addMiddleware({
137142
entrypoint: '@astrojs/cloudflare/entrypoints/middleware.js',
138143
order: 'pre',

0 commit comments

Comments
 (0)