Skip to content

Commit 30f7368

Browse files
authored
feat: add compatibility-date config option (#292)
2 parents af435a4 + 65bb6df commit 30f7368

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/vite-plugin-cloudflare-functions/src/vite/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ export function CloudflarePagesFunctions(userConfig: UserConfig = {}): Plugin {
101101
path.join(functionsRoot, '.wrangler/state'),
102102
...bindings
103103
];
104+
105+
const compatibilityDate = userConfig.wrangler?.compatibilityDate;
106+
if (compatibilityDate) {
107+
command.push('--compatibility-date');
108+
command.push(compatibilityDate);
109+
}
110+
104111
debug(command);
105112

106113
wranglerProcess = spawn('npx', command, {

packages/vite-plugin-cloudflare-functions/src/vite/types.ts

+5
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,10 @@ export interface UserConfig {
6565
* Bind R2 bucket
6666
*/
6767
r2?: string | string[];
68+
69+
/**
70+
* Determines which version of the Workers runtime is used.
71+
*/
72+
compatibilityDate?: string;
6873
};
6974
}

0 commit comments

Comments
 (0)