From 659b6f634995c78aa68ded6b7d4adad5a0c85956 Mon Sep 17 00:00:00 2001 From: Cornelius Weidmann Date: Tue, 31 Mar 2026 18:05:59 +0200 Subject: [PATCH 1/2] fix: No side-effects --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f2d5100..f9466d5 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "import": "./dist/utils-entry.js" } }, + "sideEffects": false, "files": [ "dist" ], From fcfacbf71002895d3fe5c5a1885c1d3e9f892aa3 Mon Sep 17 00:00:00 2001 From: Cornelius Weidmann Date: Tue, 31 Mar 2026 18:11:01 +0200 Subject: [PATCH 2/2] docs: Include section on tree-shaking --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 55591d2..826c455 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,26 @@ dictionary.forEach(term => { For detailed API documentation, code examples, and more, visit the **[documentation](https://kyco.github.io/dev-dict/docs)**. +## Bundle Size & Tree-Shaking + +Dev-dict contains 200+ terms. To keep your bundle small, import only the terms you need via sub-path entry points. + +**Preferred — import specific terms from `dev-dict/terms`:** + +```typescript +// GOOD - Only react and typescript are included in your bundle +import { react, typescript } from 'dev-dict/terms' +``` + +**Avoid importing from the root entry point** when you only need a subset of terms — it pulls in the entire dictionary at once and cannot be tree-shaken: + +```typescript +// BAD - Includes all 200+ terms regardless of what you use +import { terms } from 'dev-dict' +``` + +The root entry is best suited for server-side or build-time use cases where you need the full dataset (e.g. generating a static glossary page). + ## Supported Languages | Locale | Language | Status |