diff --git a/src/generators/dom/index.ts b/src/generators/dom/index.ts index 63778addb5..6f06ded60b 100644 --- a/src/generators/dom/index.ts +++ b/src/generators/dom/index.ts @@ -159,9 +159,9 @@ export default function dom( ? 'svelte/shared.js' : options.shared || ''; - const prototypeBase = - `${name}.prototype` + - (templateProperties.methods ? `, %methods` : ''); + let prototypeBase = `${name}.prototype`; + templateProperties.methods && (prototypeBase = `@assign(${prototypeBase}, %methods)`); + const proto = sharedPath ? `@proto` : deindent`