Skip to content

Commit 27534fc

Browse files
authored
Update documentation/docs/30-advanced/70-packaging.md
1 parent 0796a76 commit 27534fc

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

documentation/docs/30-advanced/70-packaging.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,20 @@ You should think carefully about whether or not the changes you make to your pac
220220

221221
## Source maps
222222

223-
You can create so-called declaration maps (`d.ts.map` files) by setting `"declarationMap": true` in your `tsconfig.json`. This will allow editors such as VS Code to go to the original `.ts` or `.svelte` file when using features like _Go to Definition_. This means you also need to publish your source files alongside your dist folder in a way that the relative path inside the declaration files leads to a file on disk.
223+
You can create so-called declaration maps (`d.ts.map` files) by setting `"declarationMap": true` in your `tsconfig.json`. This will allow editors such as VS Code to go to the original `.ts` or `.svelte` file when using features like _Go to Definition_. This means you also need to publish your source files alongside your dist folder in a way that the relative path inside the declaration files leads to a file on disk. Assuming that you have all your library code inside `src/lib` as suggested by Svelte's CLI, this is as simple as adding `src/lib` to `files` in your `package.json`:
224+
225+
```json
226+
{
227+
"files": [
228+
"dist",
229+
"!dist/**/*.test.*",
230+
"!dist/**/*.spec.*",
231+
+++"src/lib",
232+
"!src/lib/**/*.test.*",
233+
"!src/lib/**/*.spec.*"+++
234+
]
235+
}
236+
```
224237

225238
## Options
226239

0 commit comments

Comments
 (0)