feat(cli)): createRequire for SEA support (#2297)

* create require for SEA support

* Update cli/src/api/templates/js-binding.ts
This commit is contained in:
Jacky Zhao 2024-10-11 00:22:45 -07:00 committed by GitHub
parent afd081d003
commit 7ef54f413b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,8 @@ export function createCjsBinding(
/* auto-generated by NAPI-RS */
const { readFileSync } = require('fs')
const { createRequire } = require('node:module')
require = createRequire(__filename)
let nativeBinding = null
const loadErrors = []