diff --git a/build.mjs b/build.mjs index 0b3cda5..7bfe811 100644 --- a/build.mjs +++ b/build.mjs @@ -153,7 +153,9 @@ async function build(name, entry) { entryPoints: [entry], outfile, - format: "cjs", + format: "iife", + globalName: "module.exports", + platform: ["web-preload", "browser"].includes(name) ? "browser" : "node", treeShaking: true, @@ -256,7 +258,8 @@ async function buildExt(ext, side, copyManifest, fileExt) { entryPoints, outdir, - format: "cjs", + format: "iife", + globalName: "module.exports", platform: "node", treeShaking: true,