File tree 2 files changed +4
-3
lines changed
packages/vite-plugin-cloudflare-functions/src/vite
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,9 @@ export function CloudflarePagesFunctions(userConfig: UserConfig = {}): Plugin {
72
72
}
73
73
if ( userConfig . wrangler ?. do ) {
74
74
for ( const [ key , value ] of Object . entries ( userConfig . wrangler . do ) ) {
75
+ const config = typeof value === 'string' ? value : `${ value . class } @${ value . script } ` ;
75
76
bindings . push ( '--do' ) ;
76
- bindings . push ( `"${ key } =${ value } "` ) ;
77
+ bindings . push ( `"${ key } =${ config } "` ) ;
77
78
}
78
79
}
79
80
if ( userConfig . wrangler ?. r2 ) {
Original file line number Diff line number Diff line change @@ -59,15 +59,15 @@ export interface UserConfig {
59
59
/**
60
60
* Bind Durable Object
61
61
*/
62
- do ?: Record < string , string > ;
62
+ do ?: Record < string , string | { class : string ; script : string } > ;
63
63
64
64
/**
65
65
* Bind R2 bucket
66
66
*/
67
67
r2 ?: string | string [ ] ;
68
68
69
69
/**
70
- * Determines which version of the Workers runtime is used.
70
+ * Determines which version of the Workers runtime is used.
71
71
*/
72
72
compatibilityDate ?: string ;
73
73
} ;
You can’t perform that action at this time.
0 commit comments