diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index e643b40a33e0..9fdaa0cbaaa0 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -28,7 +28,7 @@ export default function dom( const builder = new CodeBuilder(); if (component.compile_options.dev) { - builder.add_line(`const ${renderer.file_var} = ${JSON.stringify(component.file)};`); + builder.add_line(`const ${renderer.file_var} = ${component.file && stringify(component.file, { only_escape_at_symbol: true })};`); } const css = component.stylesheet.render(options.filename, !options.customElement);