Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
<h1>Hello World</h1>
fetching https://unpkg.com/svelte@5.20.5/src/internal/client/index.js
import 'svelte/internal/disclose-version';
import 'svelte/internal/flags/legacy';
import * as $ from 'svelte/internal/client';

var root = $.template(`<h1>Hello World</h1>`);

export default function App($$anchor) {
var h1 = root();

$.append($$anchor, h1);
}
result = svelte.compile(source, {
generate: ,
});
/* Add a <style> tag to see the CSS output */
		
			
				
  • Root {
    • css: null
    • js: []
    • start: 0
    • end: 20
    • type: "Root"
    • fragment: Fragment {...}
      • type: "Fragment"
      • nodes: [...] (1)
        • RegularElement {...}
          • type: "RegularElement"
          • start: 0
          • end: 20
          • name: "h1"
          • attributes: []
          • fragment: Fragment {...}
            • type: "Fragment"
            • nodes: [...] (1)
              • Text {...}
                • type: "Text"
                • start: 4
                • end: 15
                • raw: "Hello World"
                • data: "Hello World"
                }
              ]
            }
          }
        ]
      }
    • options: null
    }
The AST is not public API and may change at any point in time
Compile Svelte in your Head - Hello World • Playground • Svelte