Skip to content

Commit 9eb17cf

Browse files
committed
fix
1 parent c6214ce commit 9eb17cf

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

packages/svelte/src/compiler/phases/3-transform/client/transform-client.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,22 @@ export function client_component(source, analysis, options) {
346346
)
347347
];
348348

349-
if (options.dev && options.filename) {
350-
// add `App.filename = 'App.svelte'` so that we can print useful messages later
351-
body.push(
352-
b.stmt(
353-
b.assignment(
354-
'=',
355-
b.member(b.id(analysis.name), b.id('filename')),
356-
b.literal(options.filename)
349+
if (options.dev) {
350+
if (options.filename) {
351+
// add `App.filename = 'App.svelte'` so that we can print useful messages later
352+
body.push(
353+
b.stmt(
354+
b.assignment(
355+
'=',
356+
b.member(b.id(analysis.name), b.id('filename')),
357+
b.literal(options.filename)
358+
)
357359
)
358-
)
359-
);
360+
);
361+
}
362+
363+
body.unshift(b.stmt(b.call(b.id('$.mark_module_start'), b.id(analysis.name))));
364+
body.push(b.stmt(b.call(b.id('$.mark_module_end'))));
360365
}
361366

362367
if (options.discloseVersion) {
@@ -451,11 +456,6 @@ export function client_component(source, analysis, options) {
451456
}
452457
}
453458

454-
if (options.dev && state.options.filename) {
455-
body.unshift(b.stmt(b.call(b.id('$.mark_module_start'), b.id(analysis.name))));
456-
body.push(b.stmt(b.call(b.id('$.mark_module_end'))));
457-
}
458-
459459
return {
460460
type: 'Program',
461461
sourceType: 'module',

0 commit comments

Comments
 (0)