From ea9fe9da043adfa2625e3bca789052d539637198 Mon Sep 17 00:00:00 2001 From: Hayden Bruin Date: Tue, 25 Aug 2026 15:35:45 +1000 Subject: [PATCH] fix(pkg): declare the top-level svelte field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every real Svelte library declares it — bits-ui, vaul-svelte and paneforge all carry `"svelte": "./dist/index.js"`. This package did not, because the manifest is hand-written rather than generated by the library template that includes it. vite-plugin-svelte reads that field to identify a Svelte library: its `isCommonDepWithoutSvelteField` check and the dependency crawl that builds optimizeDeps config both key off it. Without the field the package is treated as an ordinary dependency, and Vite's dev-time handling of it differs from the build — which is the class of failure behind "Failed to resolve import @engineio/ui/components/ui//index.js", reported one specifier at a time as the scanner reached each. Pairs with the `default` export condition from 0.4.2: that made the subpaths resolvable at all, this makes the toolchain treat them as Svelte source. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 72078b3..56330c0 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "sideEffects": [ "**/*.css" ], + "svelte": "./dist/index.js", "exports": { ".": { "types": "./dist/index.d.ts",