From 9139a16034a861f66c4246e3f3fe36a2e9cb5daa Mon Sep 17 00:00:00 2001 From: Hexagon Date: Tue, 8 Oct 2024 01:06:49 +0200 Subject: [PATCH] Fix umd build --- build/build.ts | 3 +++ deno.json | 2 +- src/base64.default.ts | 2 ++ src/base64.ts | 3 +-- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 src/base64.default.ts diff --git a/build/build.ts b/build/build.ts index 8eab983..8bd5006 100644 --- a/build/build.ts +++ b/build/build.ts @@ -23,6 +23,7 @@ const baseConfig = { declarations: true, compilerOptions: { //@ts-ignore outDir is valid + allowImportingTsExtensions: true, outDir: resolvedDistPath, }, }, @@ -39,10 +40,12 @@ const buildConfigs = [ }, { ...baseConfig, + entryPoints: [resolve(relativeProjectRoot, "src", "base64.default.ts")], outfile: resolve(resolvedDistPath, "base64.umd.js"), platform: "browser", format: "iife", globalName: "base64", + plugins: [] }, { ...baseConfig, diff --git a/deno.json b/deno.json index 02fc4e4..729c4a0 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@hexagon/base64", - "version": "2.0.0", + "version": "2.0.1", "exports": "./src/base64.ts", "lint": { "include": ["src", "test", "build"] diff --git a/src/base64.default.ts b/src/base64.default.ts new file mode 100644 index 0000000..385e9ae --- /dev/null +++ b/src/base64.default.ts @@ -0,0 +1,2 @@ +import { base64 } from "./base64.ts"; +export default base64; \ No newline at end of file diff --git a/src/base64.ts b/src/base64.ts index 237b71f..de6070a 100644 --- a/src/base64.ts +++ b/src/base64.ts @@ -153,5 +153,4 @@ const base64 = { }, }; -export default base64; -export { base64 }; +export { base64 }; \ No newline at end of file