Skip to content

Commit f8e8fa1

Browse files
joeattardiConduitry
authored andcommitted
Mention that svelte.pkg can point to an index file
This fixes #39.
1 parent d7e8db5 commit f8e8fa1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ If you're importing a component from your node_modules folder, and that componen
9898

9999
Conversely, if you're *publishing* a component to npm, you should ship the uncompiled source (together with the compiled distributable, for people who aren't using Svelte elsewhere in their app) and include the `"svelte"` property in your package.json.
100100

101+
If you are publishing a package containing multiple components, you can create an `index.js` file that re-exports all the components, like this:
102+
103+
```js
104+
export { default as Component1 } from './Component1.svelte';
105+
export { default as Component2 } from './Component2.svelte';
106+
```
107+
108+
and so on. Then, in `package.json`, set the `svelte` property to point to this `index.js` file.
109+
101110

102111
## Extracting CSS
103112

0 commit comments

Comments
 (0)