Skip to content

Commit

Permalink
(chore) make svelte/compiler imports named
Browse files Browse the repository at this point in the history
Technically, there is no default export, although Rollup did handle it.
  • Loading branch information
Simon Holthausen committed Mar 10, 2021
1 parent 52849e6 commit 9dfa7a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/svelte2tsx/src/htmlxtojsx/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Node } from 'estree-walker';
import MagicString from 'magic-string';
import svelte from 'svelte/compiler';
import { walk } from 'svelte/compiler';
import { parseHtmlx } from '../utils/htmlxparser';
import { getSlotName } from '../utils/svelteAst';
import { handleActionDirective } from './nodes/action-directive';
Expand Down Expand Up @@ -55,7 +55,7 @@ export function convertHtmlxToJsx(

let ifScope = new IfScope(templateScopeManager);

(svelte as any).walk(ast, {
(walk as any)(ast, {
enter: (node: Node, parent: Node, prop: string, index: number) => {
try {
switch (node.type) {
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte2tsx/src/utils/htmlxparser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import compiler from 'svelte/compiler';
import { parse } from 'svelte/compiler';
import { Node } from 'estree-walker';

function parseAttributeValue(value: string): string {
Expand Down Expand Up @@ -106,7 +106,7 @@ export function parseHtmlx(htmlx: string, options?: { emitOnTemplateError?: bool
const parsingCode = options?.emitOnTemplateError
? blankPossiblyErrorOperatorOrPropertyAccess(deconstructed)
: deconstructed;
const svelteHtmlxAst = compiler.parse(parsingCode).html;
const svelteHtmlxAst = parse(parsingCode).html;

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

0 comments on commit 9dfa7a1

Please sign in to comment.