File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Miniflare } from 'miniflare';
2
2
3
3
import { buildScriptFromManifest } from './build' ;
4
4
import { getDefaultManifestPath , resolveIntegrationManifestPath } from './manifest' ;
5
+ import { getMiniflareOptions } from './dev' ;
5
6
6
7
/**
7
8
* Check that an integration can build correctly without publishing it.
@@ -12,9 +13,7 @@ export async function checkIntegrationBuild() {
12
13
mode : 'development' ,
13
14
} ) ;
14
15
15
- const mf = new Miniflare ( {
16
- scriptPath,
17
- } ) ;
16
+ const mf = new Miniflare ( getMiniflareOptions ( scriptPath ) ) ;
18
17
await mf . ready ;
19
18
20
19
await mf . dispose ( ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,19 @@ import { resolveFile } from './manifest';
9
9
import { getAPIClient } from './remote' ;
10
10
import { createDevTunnel } from './tunnel' ;
11
11
12
+ /**
13
+ * Get the global miniflare options for an integration.
14
+ */
15
+ export function getMiniflareOptions ( scriptPath : string ) : MiniflareOptions {
16
+ return {
17
+ scriptPath,
18
+ modules : true ,
19
+ modulesRoot : path . dirname ( scriptPath ) ,
20
+ compatibilityDate : '2025-05-25' ,
21
+ compatibilityFlags : [ 'nodejs_compat' ] ,
22
+ } ;
23
+ }
24
+
12
25
/**
13
26
* Start the integrations dev server on a random available port.
14
27
* The dev server will automatically reload changes to the integration script.
@@ -51,13 +64,9 @@ export async function startIntegrationsDevServer(
51
64
spinner . start ( 'Starting dev server...' ) ;
52
65
console . log ( scriptPath ) ;
53
66
const miniflareOptions : MiniflareOptions = {
54
- scriptPath,
67
+ ... getMiniflareOptions ( scriptPath ) ,
55
68
port,
56
69
verbose : true ,
57
- modules : true ,
58
- modulesRoot : path . dirname ( scriptPath ) ,
59
- compatibilityDate : '2025-05-25' ,
60
- compatibilityFlags : [ 'nodejs_compat' ] ,
61
70
log : new Log ( LogLevel . DEBUG , {
62
71
prefix : manifest . name ,
63
72
} ) ,
You can’t perform that action at this time.
0 commit comments