Skip to content

Commit 9dfa7a1

Browse files
author
Simon Holthausen
committed
(chore) make svelte/compiler imports named
Technically, there is no default export, although Rollup did handle it.
1 parent 52849e6 commit 9dfa7a1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/svelte2tsx/src/htmlxtojsx/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Node } from 'estree-walker';
22
import MagicString from 'magic-string';
3-
import svelte from 'svelte/compiler';
3+
import { walk } from 'svelte/compiler';
44
import { parseHtmlx } from '../utils/htmlxparser';
55
import { getSlotName } from '../utils/svelteAst';
66
import { handleActionDirective } from './nodes/action-directive';
@@ -55,7 +55,7 @@ export function convertHtmlxToJsx(
5555

5656
let ifScope = new IfScope(templateScopeManager);
5757

58-
(svelte as any).walk(ast, {
58+
(walk as any)(ast, {
5959
enter: (node: Node, parent: Node, prop: string, index: number) => {
6060
try {
6161
switch (node.type) {

packages/svelte2tsx/src/utils/htmlxparser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import compiler from 'svelte/compiler';
1+
import { parse } from 'svelte/compiler';
22
import { Node } from 'estree-walker';
33

44
function parseAttributeValue(value: string): string {
@@ -106,7 +106,7 @@ export function parseHtmlx(htmlx: string, options?: { emitOnTemplateError?: bool
106106
const parsingCode = options?.emitOnTemplateError
107107
? blankPossiblyErrorOperatorOrPropertyAccess(deconstructed)
108108
: deconstructed;
109-
const svelteHtmlxAst = compiler.parse(parsingCode).html;
109+
const svelteHtmlxAst = parse(parsingCode).html;
110110

111111
//restore our script and style tags as nodes to maintain validity with HTMLx
112112
for (const s of verbatimElements) {

0 commit comments

Comments
 (0)