diff --git a/packages/svelte/src/compiler/print/index.js b/packages/svelte/src/compiler/print/index.js
index bf17b4c1e6..7e77da73d8 100644
--- a/packages/svelte/src/compiler/print/index.js
+++ b/packages/svelte/src/compiler/print/index.js
@@ -2,6 +2,7 @@
/** @import { Visitors } from 'esrap' */
import * as esrap from 'esrap';
import ts from 'esrap/languages/ts';
+import { is_void } from '../../utils.js';
/**
* @param {AST.SvelteNode} ast
@@ -19,24 +20,34 @@ export function print(ast) {
const visitors = {
Root(node, context) {
if (node.options) {
- throw new Error('TODO');
+ context.write('');
}
+ let started = false;
+
for (const item of [node.module, node.instance, node.fragment, node.css]) {
if (!item) continue;
- context.margin();
- context.newline();
+ if (started) {
+ context.margin();
+ context.newline();
+ }
+
context.visit(item);
+ started = true;
}
},
+
Script(node, context) {
context.write('