File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
packages/svelte/src/devtool Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 11export { default as DevTool } from './DevTool.svelte'
22export * from './configure.js'
3+ export { mountUI as default } from './runtime.js'
Original file line number Diff line number Diff line change 1+ import DevTool from './DevTool.svelte' ;
2+ import { mount } from 'svelte' ;
3+ function create_devtool_host ( ) {
4+ const id = 'svelte-devtool-host' ;
5+ if ( document . getElementById ( id ) != null ) {
6+ console . debug ( 'svelte-devtool-host already exists, skipping' ) ;
7+ return ;
8+ }
9+ const el = document . createElement ( 'div' ) ;
10+ el . setAttribute ( 'id' , id ) ;
11+ // appending to documentElement adds it outside of body
12+ document . documentElement . appendChild ( el ) ;
13+ return el ;
14+ }
15+ export function mountUI ( ) {
16+ if ( typeof window !== 'undefined' ) {
17+ mount ( DevTool , { target : create_devtool_host ( ) } ) ;
18+ }
19+ }
20+
21+
You can’t perform that action at this time.
0 commit comments