Skip to content

Commit c19fb3a

Browse files
cuylulivz
authored andcommitted
fix: escape backslash (#787)
1 parent f81f373 commit c19fb3a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/@vuepress/core/lib/internal-plugins/importAsyncComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function genImportAsyncComponentFile (pages) {
22
return `export function loadComponent (key) {
33
switch (key) {
4-
${pages.map(({ key, _filePath }) => ` case "${key}": return import("${_filePath}");`).join('\n')}
4+
${pages.map(({ key, _filePath }) => ` case ${JSON.stringify(key)}: return import(${JSON.stringify(_filePath)});`).join('\n')}
55
}
66
}`
77
}

packages/@vuepress/core/lib/plugin-api/option/EnhanceAppFilesOption.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = class EnhanceAppFilesOption extends Option {
5151
if (fs.existsSync(filePath)) {
5252
destPath = await context.writeTemp(
5353
`app-enhancers/enhancer-${moduleId++}.js`,
54-
`export { default } from '${(filePath)}'`
54+
`export { default } from ${JSON.stringify(filePath)}`
5555
)
5656
} else {
5757
logger.debug(

0 commit comments

Comments
 (0)