From 72b7bc7af83b52ef2a0e28f1a0011d7ffcab9df0 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Thu, 19 Dec 2024 23:07:51 +0100 Subject: [PATCH] feat: add "worker" exports condition (#14779) --- .changeset/calm-shrimps-remain.md | 5 +++++ packages/svelte/package.json | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/calm-shrimps-remain.md diff --git a/.changeset/calm-shrimps-remain.md b/.changeset/calm-shrimps-remain.md new file mode 100644 index 000000000000..280ebb3444db --- /dev/null +++ b/.changeset/calm-shrimps-remain.md @@ -0,0 +1,5 @@ +--- +'svelte': minor +--- + +feat: add "worker" exports condition to better support bundling for worker-based environments diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 1838e7c67377..36eb6fa0bcb9 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -21,6 +21,7 @@ "exports": { ".": { "types": "./types/index.d.ts", + "worker": "./src/index-server.js", "browser": "./src/index-client.js", "default": "./src/index-server.js" }, @@ -64,6 +65,7 @@ }, "./legacy": { "types": "./types/index.d.ts", + "worker": "./src/legacy/legacy-server.js", "browser": "./src/legacy/legacy-client.js", "default": "./src/legacy/legacy-server.js" }, @@ -73,6 +75,7 @@ }, "./reactivity": { "types": "./types/index.d.ts", + "worker": "./src/reactivity/index-server.js", "browser": "./src/reactivity/index-client.js", "default": "./src/reactivity/index-server.js" }, @@ -86,6 +89,7 @@ }, "./store": { "types": "./types/index.d.ts", + "worker": "./src/store/index-server.js", "browser": "./src/store/index-client.js", "default": "./src/store/index-server.js" },