From 522a4f3cc4633de3bfe31829a255cc4d5e656c78 Mon Sep 17 00:00:00 2001 From: okxint Date: Fri, 24 Jul 2026 11:38:09 +0530 Subject: [PATCH] fix(router-plugin): escape single quotes in split route file paths --- packages/router-plugin/src/core/code-splitter/compilers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/router-plugin/src/core/code-splitter/compilers.ts b/packages/router-plugin/src/core/code-splitter/compilers.ts index 89cdae41ad..c9c4868821 100644 --- a/packages/router-plugin/src/core/code-splitter/compilers.ts +++ b/packages/router-plugin/src/core/code-splitter/compilers.ts @@ -623,7 +623,7 @@ export function compileCodeSplitReferenceRoute( ) { programPath.unshiftContainer('body', [ template.statement( - `const ${splitNodeMeta.localImporterIdent} = () => import('${splitUrl}')`, + `const ${splitNodeMeta.localImporterIdent} = () => import('${splitUrl.replace(/'/g, "\\'")}')`, )(), ]) } @@ -719,7 +719,7 @@ export function compileCodeSplitReferenceRoute( ) { programPath.unshiftContainer('body', [ template.statement( - `const ${splitNodeMeta.localImporterIdent} = () => import('${splitUrl}')`, + `const ${splitNodeMeta.localImporterIdent} = () => import('${splitUrl.replace(/'/g, "\\'")}')`, )(), ]) }