From 57d082ced4532ffc4d0997891d113f300b750f38 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Mon, 29 Aug 2022 22:02:34 +1000 Subject: [PATCH 1/8] Fix addons in examples. Allow `preview.js` etc to be the name of the package exports --- code/lib/core-common/src/presets.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index c12ebd0d4933..c4696b8fc655 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -93,10 +93,10 @@ export const resolveAddonName = ( const path = name; // when user provides full path, we don't need to do anything! - const managerFile = r(`${path}/manager`); + const managerFile = r(`${path}/manager`) || r(`${path}/manager.js`); const registerFile = r(`${path}/register`) || r(`${path}/register-panel`); - const previewFile = r(`${path}/preview`); - const presetFile = r(`${path}/preset`); + const previewFile = r(`${path}/preview`) || r(`${path}/preview.js`); + const presetFile = r(`${path}/preset`) || r(`${path}/preset.js`); if (!(managerFile || previewFile) && presetFile) { return { From 57d5b1ae3bdb92ce3b303eb8b094487cd0db3b3d Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Tue, 30 Aug 2022 14:44:19 +1000 Subject: [PATCH 2/8] Don't return resolved path from browser preset entries Instead, just return the import path unresolved --- code/lib/core-common/src/presets.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index c4696b8fc655..f467450ef445 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -72,6 +72,7 @@ export const resolveAddonName = ( options: any ): ResolvedAddonPreset | ResolvedAddonVirtual | undefined => { const r = name.startsWith('/') ? safeResolve : safeResolveFrom.bind(null, configDir); + const ifResolves = (path: string) => r(path) && path; const resolved = r(name); if (resolved) { @@ -93,10 +94,10 @@ export const resolveAddonName = ( const path = name; // when user provides full path, we don't need to do anything! - const managerFile = r(`${path}/manager`) || r(`${path}/manager.js`); - const registerFile = r(`${path}/register`) || r(`${path}/register-panel`); - const previewFile = r(`${path}/preview`) || r(`${path}/preview.js`); - const presetFile = r(`${path}/preset`) || r(`${path}/preset.js`); + const managerFile = ifResolves(`${path}/manager`); + const registerFile = ifResolves(`${path}/register`) || ifResolves(`${path}/register-panel`); + const previewFile = ifResolves(`${path}/preview`); + const presetFile = r(`${path}/preset`); if (!(managerFile || previewFile) && presetFile) { return { From 7eae837fcccf13cea74e7b1f50a71e3ce5d2fe91 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Tue, 30 Aug 2022 14:46:23 +1000 Subject: [PATCH 3/8] Revert changes to `exports` fields of addons/renderers All of Node, Webpack and Vite can `import('/preview')` etc, as long as the `exports` map is there and setup like so. If the `exports` map is not there, then they can import `node_modules//preview.js` instead. The issue occurred when an export map existed but Vite tried to import a path that wasn't defined in there. --- code/addons/a11y/package.json | 6 +++--- code/addons/backgrounds/package.json | 6 +++--- code/addons/controls/package.json | 4 ++-- code/addons/jest/package.json | 4 ++-- code/addons/links/package.json | 6 +++--- code/addons/measure/package.json | 6 +++--- code/addons/outline/package.json | 6 +++--- code/addons/toolbars/package.json | 4 ++-- code/addons/viewport/package.json | 2 +- code/renderers/html/package.json | 2 +- code/renderers/preact/package.json | 2 +- code/renderers/react/package.json | 17 +++++++++++++++++ code/renderers/server/package.json | 2 +- code/renderers/svelte/package.json | 17 +++++++++++++++++ code/renderers/vue/package.json | 2 +- code/renderers/vue3/package.json | 17 +++++++++++++++++ code/renderers/web-components/package.json | 2 +- 17 files changed, 78 insertions(+), 27 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 7021b39256de..1639e97b375c 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -31,17 +31,17 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/preview.js", "import": "./dist/preview.mjs", "types": "./dist/preview.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 047fca4ea24b..8b2e260a6667 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -31,17 +31,17 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/preview.js", "import": "./dist/preview.mjs", "types": "./dist/preview.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 2caa1e15311f..8b99d25f6b9e 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -31,12 +31,12 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index be19a0204cac..46b4051f5498 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -33,12 +33,12 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 5f6800e67f87..91d7b97b6a22 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -27,12 +27,12 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/preview.js", "import": "./dist/preview.mjs", "types": "./dist/preview.d.ts" @@ -42,7 +42,7 @@ "import": "./dist/react/index.mjs", "types": "./dist/react.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 25d72e7698a2..d9476ef1e68b 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -30,17 +30,17 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/preview.js", "import": "./dist/preview.mjs", "types": "./dist/preview.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index b0d86dcc0371..34ac74ddd396 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -33,17 +33,17 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/preset/preview.js", "import": "./dist/preset/preview.mjs", "types": "./dist/preview.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 14a9b118ac27..f64ff192efeb 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -31,12 +31,12 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./manager.js": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 458414c8c620..454fceafc966 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -38,7 +38,7 @@ "import": "./dist/preview.mjs", "types": "./dist/preview.d.ts" }, - "./register.js": { + "./register": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 6488b13031ba..a69f7640b6e6 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -25,7 +25,7 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/config.js", "import": "./dist/config.mjs", "types": "./dist/config.d.ts" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 8806828d838d..6d7b7d4d4209 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -25,7 +25,7 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/config.js", "import": "./dist/config.mjs", "types": "./dist/config.d.ts" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index d29b3678f044..f5ff24462cf1 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -19,6 +19,23 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./preview": { + "require": "./dist/config.js", + "import": "./dist/config.mjs", + "types": "./dist/config.d.ts" + }, + "./package.json": { + "require": "./package.json", + "import": "./package.json", + "types": "./package.json" + } + }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 97f4eb2385b1..33a939b41feb 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -25,7 +25,7 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/config.js", "import": "./dist/config.mjs", "types": "./dist/config.d.ts" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index f58fb4ad731a..975797db058a 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -19,6 +19,23 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./preview": { + "require": "./dist/config.js", + "import": "./dist/config.mjs", + "types": "./dist/config.d.ts" + }, + "./package.json": { + "require": "./package.json", + "import": "./package.json", + "types": "./package.json" + } + }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index d19489ad8b57..947049eea43e 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -25,7 +25,7 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/config.js", "import": "./dist/config.mjs", "types": "./dist/config.d.ts" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index ebb7babcffd1..c8fbd117a47b 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -19,6 +19,23 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./preview": { + "require": "./dist/config.js", + "import": "./dist/config.mjs", + "types": "./dist/config.d.ts" + }, + "./package.json": { + "require": "./package.json", + "import": "./package.json", + "types": "./package.json" + } + }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 8b4d839e3fbd..1acdeddbfca1 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -27,7 +27,7 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./preview.js": { + "./preview": { "require": "./dist/config.js", "import": "./dist/config.mjs", "types": "./dist/config.d.ts" From e3f0e26b3b5341e9444494a8751a3051265f1581 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Tue, 30 Aug 2022 22:24:48 +1000 Subject: [PATCH 4/8] Use pseudo absolute exports for preview/manager entries --- .../src/codegen-modern-iframe-script.ts | 1 + code/lib/core-common/src/presets.ts | 35 +++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/code/lib/builder-vite/src/codegen-modern-iframe-script.ts b/code/lib/builder-vite/src/codegen-modern-iframe-script.ts index dab3c52cebea..248a8381c5ab 100644 --- a/code/lib/builder-vite/src/codegen-modern-iframe-script.ts +++ b/code/lib/builder-vite/src/codegen-modern-iframe-script.ts @@ -9,6 +9,7 @@ export async function generateModernIframeScriptCode(options: ExtendedOptions) { const previewOrConfigFile = loadPreviewOrConfigFile({ configDir }); const presetEntries = await presets.apply('config', [], options); + console.log(presetEntries); const previewEntries = await presets.apply('previewEntries', [], options); const absolutePreviewEntries = previewEntries.map((entry) => isAbsolute(entry) ? entry : resolve(entry) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index f467450ef445..69761cb08de7 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -1,5 +1,6 @@ import { dedent } from 'ts-dedent'; import { logger } from '@storybook/node-logger'; +import { dirname, resolve } from 'path'; import { CLIOptions, LoadedPreset, @@ -71,9 +72,8 @@ export const resolveAddonName = ( name: string, options: any ): ResolvedAddonPreset | ResolvedAddonVirtual | undefined => { - const r = name.startsWith('/') ? safeResolve : safeResolveFrom.bind(null, configDir); - const ifResolves = (path: string) => r(path) && path; - const resolved = r(name); + const resolve = name.startsWith('/') ? safeResolve : safeResolveFrom.bind(null, configDir); + const resolved = resolve(name); if (resolved) { if (name.match(/\/(manager|register(-panel)?)(\.(js|ts|tsx|jsx))?$/)) { @@ -91,13 +91,34 @@ export const resolveAddonName = ( } } + const absolutePackageJson = resolved && resolve(`${name}/package.json`); + + // We don't want to resolve an import path (e.g. '@addons/foo/preview') to the file on disk, + // because you are not allowed to import arbitrary files in packages in Vite. + // We want to absolutize the package name part to a path on disk + // (i.e. '/Users/foo/.../node_modules/@addons/foo') as otherwise + // we may not be able to import the package in certain module systems (eg. pnpm, yarn pnp) + const absoluteDir = absolutePackageJson && dirname(absolutePackageJson); + + // If the package has an export (e.g. `/preview`), absolutize it, eg. to + // /Users/foo/.../node_modules/@addons/foo/preview + // NOTE: this looks like the path of an absolute file, but it DOES NOT exist. + // - However it is importable by webpack. + // - Vite needs to strip off the absolute part to import it though + // (vite cannot import absolute files: https://github.com/vitejs/vite/issues/5494 + // this also means vite suffers issues with pnpm etc) + const absolutizeExport = (exportName: string) => { + if (resolve(`${name}${exportName}`)) return `${absoluteDir}${exportName}`; + return undefined; + }; + const path = name; // when user provides full path, we don't need to do anything! - const managerFile = ifResolves(`${path}/manager`); - const registerFile = ifResolves(`${path}/register`) || ifResolves(`${path}/register-panel`); - const previewFile = ifResolves(`${path}/preview`); - const presetFile = r(`${path}/preset`); + const managerFile = absolutizeExport(`/manager`); + const registerFile = absolutizeExport(`$/register`) || absolutizeExport(`/register-panel`); + const previewFile = absolutizeExport(`/preview`); + const presetFile = resolve(`${path}/preset`); if (!(managerFile || previewFile) && presetFile) { return { From c29a9129efaa06fb18d394cc3a68291bb877e601 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Tue, 30 Aug 2022 22:26:24 +1000 Subject: [PATCH 5/8] Remove spurious log --- code/lib/builder-vite/src/codegen-modern-iframe-script.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/code/lib/builder-vite/src/codegen-modern-iframe-script.ts b/code/lib/builder-vite/src/codegen-modern-iframe-script.ts index 248a8381c5ab..dab3c52cebea 100644 --- a/code/lib/builder-vite/src/codegen-modern-iframe-script.ts +++ b/code/lib/builder-vite/src/codegen-modern-iframe-script.ts @@ -9,7 +9,6 @@ export async function generateModernIframeScriptCode(options: ExtendedOptions) { const previewOrConfigFile = loadPreviewOrConfigFile({ configDir }); const presetEntries = await presets.apply('config', [], options); - console.log(presetEntries); const previewEntries = await presets.apply('previewEntries', [], options); const absolutePreviewEntries = previewEntries.map((entry) => isAbsolute(entry) ? entry : resolve(entry) From bb294e9b84603432f618e3a876fafb8ac4dc088a Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Tue, 30 Aug 2022 22:28:48 +1000 Subject: [PATCH 6/8] Fix typo --- code/lib/core-common/src/presets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index 69761cb08de7..aa9264cc277c 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -116,7 +116,7 @@ export const resolveAddonName = ( // when user provides full path, we don't need to do anything! const managerFile = absolutizeExport(`/manager`); - const registerFile = absolutizeExport(`$/register`) || absolutizeExport(`/register-panel`); + const registerFile = absolutizeExport(`/register`) || absolutizeExport(`/register-panel`); const previewFile = absolutizeExport(`/preview`); const presetFile = resolve(`${path}/preset`); From 5aadc0fd61cfb3a05c934a2c096b464d5fc5e4c6 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Tue, 30 Aug 2022 22:29:58 +1000 Subject: [PATCH 7/8] Update comments --- code/lib/core-common/src/presets.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index aa9264cc277c..b7b6817f5b26 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -93,8 +93,6 @@ export const resolveAddonName = ( const absolutePackageJson = resolved && resolve(`${name}/package.json`); - // We don't want to resolve an import path (e.g. '@addons/foo/preview') to the file on disk, - // because you are not allowed to import arbitrary files in packages in Vite. // We want to absolutize the package name part to a path on disk // (i.e. '/Users/foo/.../node_modules/@addons/foo') as otherwise // we may not be able to import the package in certain module systems (eg. pnpm, yarn pnp) @@ -114,10 +112,13 @@ export const resolveAddonName = ( const path = name; - // when user provides full path, we don't need to do anything! + // We don't want to resolve an import path (e.g. '@addons/foo/preview') to the file on disk, + // because you are not allowed to import arbitrary files in packages in Vite. + // Instead we check if the export exists and "absolutize" it. const managerFile = absolutizeExport(`/manager`); const registerFile = absolutizeExport(`/register`) || absolutizeExport(`/register-panel`); const previewFile = absolutizeExport(`/preview`); + // Presets are imported by node, so therefore fine to be a path on disk (at this stage anyway) const presetFile = resolve(`${path}/preset`); if (!(managerFile || previewFile) && presetFile) { From 9d689a86b61285e499ddfb3da04163e7d7d427e6 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Tue, 30 Aug 2022 23:00:10 +1000 Subject: [PATCH 8/8] Restore svelte exports properly --- code/lib/core-common/src/presets.ts | 2 +- code/renderers/svelte/package.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index b7b6817f5b26..cb69104b2860 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -1,6 +1,6 @@ import { dedent } from 'ts-dedent'; import { logger } from '@storybook/node-logger'; -import { dirname, resolve } from 'path'; +import { dirname } from 'path'; import { CLIOptions, LoadedPreset, diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 975797db058a..22ab61a50ecf 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -34,7 +34,10 @@ "require": "./package.json", "import": "./package.json", "types": "./package.json" - } + }, + "./templates/HOC.svelte": "./templates/HOC.svelte", + "./templates/PreviewRender.svelte": "./templates/PreviewRender.svelte", + "./templates/SlotDecorator.svelte": "./templates/SlotDecorator.svelte" }, "main": "dist/index.js", "module": "dist/index.mjs",