diff --git a/packages/svelte/src/compiler/index.js b/packages/svelte/src/compiler/index.js index 42427dd9c4..756a88a824 100644 --- a/packages/svelte/src/compiler/index.js +++ b/packages/svelte/src/compiler/index.js @@ -43,6 +43,11 @@ export function compile(source, options) { instance: parsed.instance && remove_typescript_nodes(parsed.instance), module: parsed.module && remove_typescript_nodes(parsed.module) }; + if (combined_options.customElementOptions?.extend) { + combined_options.customElementOptions.extend = remove_typescript_nodes( + combined_options.customElementOptions?.extend + ); + } } const analysis = analyze_component(parsed, source, combined_options); diff --git a/packages/svelte/src/compiler/phases/1-parse/index.js b/packages/svelte/src/compiler/phases/1-parse/index.js index 5c72d2003f..6cc5b58aa6 100644 --- a/packages/svelte/src/compiler/phases/1-parse/index.js +++ b/packages/svelte/src/compiler/phases/1-parse/index.js @@ -143,7 +143,7 @@ export class Parser { if (options_index !== -1) { const options = /** @type {AST.SvelteOptionsRaw} */ (this.root.fragment.nodes[options_index]); this.root.fragment.nodes.splice(options_index, 1); - this.root.options = read_options(options, this.ts); + this.root.options = read_options(options); disallow_children(options); diff --git a/packages/svelte/src/compiler/phases/1-parse/read/options.js b/packages/svelte/src/compiler/phases/1-parse/read/options.js index 51c682ade7..a36e101468 100644 --- a/packages/svelte/src/compiler/phases/1-parse/read/options.js +++ b/packages/svelte/src/compiler/phases/1-parse/read/options.js @@ -2,14 +2,12 @@ /** @import { AST } from '#compiler' */ import { NAMESPACE_MATHML, NAMESPACE_SVG } from '../../../../constants.js'; import * as e from '../../../errors.js'; -import { remove_typescript_nodes } from '../remove_typescript_nodes.js'; /** * @param {AST.SvelteOptionsRaw} node - * @param {boolean} ts * @returns {AST.Root['options']} */ -export default function read_options(node, ts) { +export default function read_options(node) { /** @type {AST.SvelteOptions} */ const component_options = { start: node.start, @@ -144,7 +142,7 @@ export default function read_options(node, ts) { const extend = properties.find(([name]) => name === 'extend')?.[1]; if (extend) { - ce.extend = ts ? remove_typescript_nodes(extend) : extend; + ce.extend = extend; } component_options.customElement = ce;