Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 6c59d92

Browse files
authored
Merge pull request #76 from payellodevsupport/patch-1
Move .env file parsing code to end. Fixes #75
2 parents 76cfa71 + 381e2de commit 6c59d92

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/core/src/plugins/bindings.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ export class BindingsPlugin
8383
const bindings: Context = {};
8484
const watch: string[] = [];
8585

86+
// Load WebAssembly module bindings from files
87+
if (this.wasmBindings) {
88+
for (const [name, wasmPath] of Object.entries(this.wasmBindings)) {
89+
bindings[name] = new WebAssembly.Module(await fs.readFile(wasmPath));
90+
watch.push(wasmPath);
91+
}
92+
}
93+
94+
// Copy user's arbitrary bindings
95+
Object.assign(bindings, this.bindings);
96+
8697
// Load bindings from .env file
8798
const envPath = this.envPath === true ? this.defaultEnvPath : this.envPath;
8899
if (envPath) {
@@ -98,17 +109,6 @@ export class BindingsPlugin
98109
watch.push(envPath);
99110
}
100111

101-
// Load WebAssembly module bindings from files
102-
if (this.wasmBindings) {
103-
for (const [name, wasmPath] of Object.entries(this.wasmBindings)) {
104-
bindings[name] = new WebAssembly.Module(await fs.readFile(wasmPath));
105-
watch.push(wasmPath);
106-
}
107-
}
108-
109-
// Copy user's arbitrary bindings
110-
Object.assign(bindings, this.bindings);
111-
112112
return { globals: this.globals, bindings, watch };
113113
}
114114
}

0 commit comments

Comments
 (0)