Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
20 changes: 19 additions & 1 deletion vite.config.mts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Loading