Skip to content

Commit d2982b4

Browse files
chore: improve inspector docs (#1197)
* chore: improve inspector docs * Update packages/vite-plugin-svelte-inspector/README.md Co-authored-by: Rich Harris <[email protected]> --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 7bcf224 commit d2982b4

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.changeset/angry-dolls-cut.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/vite-plugin-svelte-inspector': patch
3+
---
4+
5+
docs: update usage instructions in readme and link to docs

packages/vite-plugin-svelte-inspector/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ A [Svelte](https://svelte.dev) inspector plugin for [Vite](https://vitejs.dev).
44

55
## Usage
66

7+
This plugin is automatically installed as a dependency of [@sveltejs/vite-plugin-svelte](https://www.npmjs.com/package/@sveltejs/vite-plugin-svelte).
8+
9+
You can enable it in `svelte.config.js` by adding the `vitePlugin.inspector` option.
10+
711
```js
8-
// vite.config.js
9-
import { defineConfig } from 'vite';
10-
import { svelte } from '@sveltejs/vite-plugin-svelte';
11-
import { svelteInspector } from '@sveltejs/vite-plugin-svelte-inspector';
12-
13-
export default defineConfig({
14-
plugins: [
15-
// the svelte plugin is required to work
16-
svelte(),
17-
svelteInspector({
18-
/* plugin options */
19-
})
20-
]
21-
});
12+
// svelte.config.js
13+
export default {
14+
vitePlugin: {
15+
inspector: true
16+
}
17+
};
2218
```
2319

20+
Now simply press `alt-x` (`option-x` on MacOS) on a page served by the Vite dev server to activate inspect mode. Click on a highlighted element to jump to its source code in your editor.
21+
22+
Also check out the [docs](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/inspector.md) for customization options.
23+
2424
## License
2525

2626
[MIT](./LICENSE)

0 commit comments

Comments
 (0)