diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2023-11-29 20:13:15 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2023-11-29 20:13:15 -0500 |
commit | e215656ce9b965360e540da93ebf5c381cbe4e41 (patch) | |
tree | 4937ca040460d775472f1f3ce1bb179af7b0b661 /dev/build-libs.js | |
parent | ec67de5c0c4abc11232d3f3a8a8e9bb2fe045daa (diff) |
Update types
Diffstat (limited to 'dev/build-libs.js')
-rw-r--r-- | dev/build-libs.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dev/build-libs.js b/dev/build-libs.js index d33c1420..eee007f6 100644 --- a/dev/build-libs.js +++ b/dev/build-libs.js @@ -26,15 +26,18 @@ import {fileURLToPath} from 'url'; const dirname = path.dirname(fileURLToPath(import.meta.url)); const extDir = path.join(dirname, '..', 'ext'); -async function buildLib(p) { +/** + * @param {string} scriptPath + */ +async function buildLib(scriptPath) { await esbuild.build({ - entryPoints: [p], + entryPoints: [scriptPath], bundle: true, minify: false, sourcemap: true, target: 'es2020', format: 'esm', - outfile: path.join(extDir, 'lib', path.basename(p)), + outfile: path.join(extDir, 'lib', path.basename(scriptPath)), external: ['fs'], banner: { js: '// @ts-nocheck' @@ -55,7 +58,7 @@ export async function buildLibs() { const schemaDir = path.join(extDir, 'data/schemas/'); const schemaFileNames = fs.readdirSync(schemaDir); - const schemas = schemaFileNames.map((schemaFileName) => JSON.parse(fs.readFileSync(path.join(schemaDir, schemaFileName)))); + const schemas = schemaFileNames.map((schemaFileName) => JSON.parse(fs.readFileSync(path.join(schemaDir, schemaFileName), {encoding: 'utf8'}))); const ajv = new Ajv({schemas: schemas, code: {source: true, esm: true}}); const moduleCode = standaloneCode(ajv); |