File tree 3 files changed +6
-10
lines changed
3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,13 @@ export const TransactionCacheEntry = globalThis.TransactionCacheEntry;
115
115
} ,
116
116
} ;
117
117
118
- export async function bundle ( input , enableExperimentalTopLevelAwait = false ) {
118
+ export async function bundle ( input , moduleMode = false ) {
119
119
return await build ( {
120
120
conditions : [ 'fastly' ] ,
121
121
entryPoints : [ input ] ,
122
122
bundle : true ,
123
123
write : false ,
124
- format : enableExperimentalTopLevelAwait ? 'esm' : 'iife' ,
124
+ format : moduleMode ? 'esm' : 'iife' ,
125
125
tsconfig : undefined ,
126
126
plugins : [ fastlyPlugin ] ,
127
127
} ) ;
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ export async function compileApplicationToWasm(
124
124
} else {
125
125
let contents ;
126
126
try {
127
- contents = await bundle ( input , enableExperimentalTopLevelAwait ) ;
127
+ contents = await bundle ( input , moduleMode ) ;
128
128
} catch ( error ) {
129
129
console . error ( `Error:` , error . message ) ;
130
130
process . exit ( 1 ) ;
@@ -133,7 +133,7 @@ export async function compileApplicationToWasm(
133
133
let wizerInput = precompile (
134
134
contents . outputFiles [ 0 ] . text ,
135
135
undefined ,
136
- enableExperimentalTopLevelAwait ,
136
+ moduleMode ,
137
137
) ;
138
138
139
139
// for StarlingMonkey, we need to write to a tmpdir pending streaming source hooks or similar
Original file line number Diff line number Diff line change @@ -12,18 +12,14 @@ const POSTAMBLE = '}';
12
12
/// will intern regular expressions, duplicating them at the top level and testing them with both
13
13
/// an ascii and utf8 string should ensure that they won't be re-compiled when run in the fetch
14
14
/// handler.
15
- export function precompile (
16
- source ,
17
- filename = '<input>' ,
18
- enableExperimentalTopLevelAwait = false ,
19
- ) {
15
+ export function precompile ( source , filename = '<input>' , moduleMode = false ) {
20
16
const magicString = new MagicString ( source , {
21
17
filename,
22
18
} ) ;
23
19
24
20
const ast = parse ( source , {
25
21
ecmaVersion : 'latest' ,
26
- sourceType : enableExperimentalTopLevelAwait ? 'module' : 'script' ,
22
+ sourceType : moduleMode ? 'module' : 'script' ,
27
23
} ) ;
28
24
29
25
const precompileCalls = [ ] ;
You can’t perform that action at this time.
0 commit comments