Skip to content

Commit

Permalink
fixing bug with build script affecting 'bundlers/walc-external-bundle…
Browse files Browse the repository at this point in the history
….js'
  • Loading branch information
getify committed Mar 27, 2024
1 parent 7afa9fb commit f742095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lo-fi/webauthn-local-client",
"description": "Browser-only utils for locally managing WebAuthn (passkey) API",
"version": "0.999.3",
"version": "0.999.4",
"exports": {
".": "./dist/bundlers/walc.mjs",
"./bundlers/vite": "./bundler-plugins/vite.mjs",
Expand Down
6 changes: 3 additions & 3 deletions scripts/build-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async function main() {
// build walc-external-bundle.js
var walcExternalBundleContents = [
`/*! ${path.basename(ASN1_SRC)} */`, asn1Contents.trim(),
`/*! ${path.basename(CBOR_SRC)} */`, await minifyJS(cborContents),
`/*! ${path.basename(CBOR_SRC)} */`, await minifyJS(cborContents,/*esModuleFormat=*/false),
`/*! ${path.basename(LIBSODIUM_SRC)} */`, libsodiumContents.trim(),
`/*! ${path.basename(LIBSODIUM_WRAPPERS_SRC)} */`, libsodiumWrappersContents.trim(),
].join("\n");
Expand Down Expand Up @@ -192,7 +192,7 @@ async function buildFiles(files,fromBasePath,toDir,processFileContents,skipPatte
}
}

async function minifyJS(contents) {
async function minifyJS(contents,esModuleFormat = true) {
let result = await terser.minify(contents,{
mangle: {
keep_fnames: true,
Expand All @@ -203,7 +203,7 @@ async function minifyJS(contents) {
output: {
comments: /^!/,
},
module: true,
module: esModuleFormat,
});
if (!(result && result.code)) {
if (result.error) throw result.error;
Expand Down

0 comments on commit f742095

Please sign in to comment.