diff --git a/packages/svelte2tsx/src/svelte2tsx/nodes/Scripts.ts b/packages/svelte2tsx/src/svelte2tsx/nodes/Scripts.ts
index 853a72fd1..560e00de0 100644
--- a/packages/svelte2tsx/src/svelte2tsx/nodes/Scripts.ts
+++ b/packages/svelte2tsx/src/svelte2tsx/nodes/Scripts.ts
@@ -35,7 +35,11 @@ export class Scripts {
if (
tag.attributes &&
tag.attributes.find(
- (a) => a.name == 'context' && a.value.length == 1 && a.value[0].raw == 'module'
+ (a) =>
+ (a.name == 'context' &&
+ a.value.length == 1 &&
+ a.value[0].raw == 'module') ||
+ a.name === 'module'
)
) {
moduleScriptTag = tag;
diff --git a/packages/svelte2tsx/test/svelte2tsx/samples/module-script-and-script3.v5/expectedv2.ts b/packages/svelte2tsx/test/svelte2tsx/samples/module-script-and-script3.v5/expectedv2.ts
new file mode 100644
index 000000000..6406a56c2
--- /dev/null
+++ b/packages/svelte2tsx/test/svelte2tsx/samples/module-script-and-script3.v5/expectedv2.ts
@@ -0,0 +1,15 @@
+///