Skip to content

Commit 58ec8fa

Browse files
committed
dont require(esm)
1 parent 12202d4 commit 58ec8fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/check-build.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function clean(err) {
99
return err.toString().trim();
1010
}
1111

12-
function recompileFromSource() {
12+
async function recompileFromSource() {
1313
console.log('Compiling from source...');
1414
let spawn = child_process.spawnSync('node-gyp', ['configure'], {
1515
stdio: ['inherit', 'inherit', 'pipe'],
@@ -32,7 +32,7 @@ function recompileFromSource() {
3232
return;
3333
}
3434

35-
require('./copy-target.mjs');
35+
await import('./copy-target.mjs');
3636
}
3737

3838
if (fs.existsSync(binaries.target)) {
@@ -47,13 +47,13 @@ if (fs.existsSync(binaries.target)) {
4747
console.log(e);
4848
}
4949
try {
50-
recompileFromSource();
50+
await recompileFromSource();
5151
} catch (e) {
5252
console.log('Failed to compile from source');
5353
throw e;
5454
}
5555
}
5656
} else {
5757
console.log('No precompiled binary found');
58-
recompileFromSource();
58+
await recompileFromSource();
5959
}

0 commit comments

Comments
 (0)