diff --git a/packages/blob/README.md b/packages/blob/README.md index 9f4ade718..bd31a6ab6 100644 --- a/packages/blob/README.md +++ b/packages/blob/README.md @@ -18,9 +18,13 @@ yarn add @huggingface/blob ```ts // esm.sh -import { FileBlob, WebBlob } from "https://esm.sh/@huggingface/blob"; +import { FileBlob } from "https://esm.sh/@huggingface/blob/FileBlob"; +import { WebBlob } from "https://esm.sh/@huggingface/blob/WebBlob"; +import { createBlob } from "https://esm.sh/@huggingface/blob"; // or npm: -import { FileBlob, WebBlob } from "npm:@huggingface/blob"; +import { FileBlob } from "npm:@huggingface/blob/FileBlob"; +import { WebBlob } from "npm:@huggingface/blob/WebBlob"; +import { createBlob } from "npm:@huggingface/blob"; ``` ## Usage diff --git a/packages/blob/package.json b/packages/blob/package.json index ad7289ee1..74a986c4a 100644 --- a/packages/blob/package.json +++ b/packages/blob/package.json @@ -15,6 +15,17 @@ "types": "./dist/index.d.ts", "require": "./dist/index.js", "import": "./dist/index.mjs" + }, + "./package.json": "./package.json", + "./WebBlob": { + "types": "./dist/WebBlob.d.ts", + "require": "./dist/WebBlob.js", + "import": "./dist/WebBlob.mjs" + }, + "./FileBlob": { + "types": "./dist/FileBlob.d.ts", + "require": "./dist/FileBlob.js", + "import": "./dist/FileBlob.mjs" } }, "browser": { @@ -22,9 +33,6 @@ "./dist/index.js": "./dist/browser/index.js", "./dist/index.mjs": "./dist/browser/index.mjs" }, - "engines": { - "node": ">=18" - }, "source": "index.ts", "scripts": { "lint": "eslint --quiet --fix --ext .cjs,.ts .", diff --git a/packages/blob/src/index.ts b/packages/blob/src/index.ts index 983542526..b41a757cf 100644 --- a/packages/blob/src/index.ts +++ b/packages/blob/src/index.ts @@ -1,2 +1 @@ export * from "./utils/createBlob"; -export * from "./utils/WebBlob"; diff --git a/packages/blob/tsup.config.ts b/packages/blob/tsup.config.ts index 6be4e128a..c08bf2a12 100644 --- a/packages/blob/tsup.config.ts +++ b/packages/blob/tsup.config.ts @@ -9,11 +9,13 @@ const baseConfig: Options = { const nodeConfig: Options = { ...baseConfig, + entry: ["./index.ts", "./src/utils/WebBlob.ts", "./src/utils/FileBlob.ts"], platform: "node", }; const browserConfig: Options = { ...baseConfig, + entry: ["./index.ts", "./src/utils/WebBlob.ts"], platform: "browser", target: "es2018", splitting: true,