From cee806b62c202d223d3453eb092e248326ad5a6b Mon Sep 17 00:00:00 2001 From: Sharon Stratsianis Date: Thu, 19 Nov 2026 22:49:00 +1100 Subject: [PATCH] package dokeili --- README.md | 4 ++++ vite.config.mts | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 114b7877..52b220e8 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ The UMD bundles externalize `rdflib` only. The ESM bundles externalize both `rdflib` and the auth library packages `@uvdsl/solid-oidc-client-browser` / `@uvdsl/solid-oidc-client-browser/core`. +The ESM and CommonJS builds bundle `@dokieli/web-access-control` and its +runtime dependencies so CommonJS consumers do not need to load its ESM-only +package entry directly. + ## Available Files | Format | File | Usage | Global Variable | diff --git a/vite.config.mts b/vite.config.mts index d6700719..99d25ab9 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -1,7 +1,25 @@ +import { isAbsolute } from 'node:path' import { buildConfig } from "solidos-toolkit/vite"; import { defineConfig } from "vitest/config"; -const build = buildConfig({ entry: "src/index.ts" }) ?? {}; +const bundledCjsDependencies = new Set([ + '@dokieli/web-access-control', + '@rdfjs/data-model', + '@rdfjs/types', + 'n3' +]) + +const build = buildConfig({ + entry: "src/index.ts", + overrides: { + rolldownOptions: { + external: (id: string) => { + if (bundledCjsDependencies.has(id)) return false + return !id.startsWith("~icons/") && !id.startsWith("@/") && !id.startsWith(".") && !isAbsolute(id) + } + } + } +}) ?? {}; export default defineConfig({ build,