Skip to content

Commit

Permalink
Add support for wrangler.jsonc (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
meyer authored Dec 6, 2024
1 parent f08b855 commit 1d4e6fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-days-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': minor
---

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.
9 changes: 7 additions & 2 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ export default function createIntegration(args?: Options): AstroIntegration {
integrations: [astroWhen()],
image: setImageConfig(args?.imageService ?? 'compile', config.image, command, logger),
});
addWatchFile(new URL('./wrangler.toml', config.root));
addWatchFile(new URL('./wrangler.json', config.root));
if (args?.platformProxy?.configPath) {
addWatchFile(new URL(args.platformProxy.configPath, config.root));
} else {
addWatchFile(new URL('./wrangler.toml', config.root));
addWatchFile(new URL('./wrangler.json', config.root));
addWatchFile(new URL('./wrangler.jsonc', config.root));
}
addMiddleware({
entrypoint: '@astrojs/cloudflare/entrypoints/middleware.js',
order: 'pre',
Expand Down

0 comments on commit 1d4e6fc

Please sign in to comment.