File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1- import { path , sanitizeFileName } from '@vuepress/utils'
1+ import { path , transformPathToFileName } from '@vuepress/utils'
22import type { App } from '../types/index.js'
33
44/**
@@ -17,7 +17,7 @@ export const resolvePageChunkInfo = ({
1717} => {
1818 const chunkFilePathRelative = path . join ( 'pages' , `${ htmlFilePathRelative } .js` )
1919 const chunkFilePath = app . dir . temp ( chunkFilePathRelative )
20- const chunkName = sanitizeFileName ( path . basename ( htmlFilePathRelative ) )
20+ const chunkName = transformPathToFileName ( htmlFilePathRelative )
2121
2222 return {
2323 chunkFilePath,
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ export * from './getDirname.js'
22export * from './importFile.js'
33export * from './isChildPath.js'
44export * from './sanitizeFileName.js'
5+ export * from './transformPathToFileName.js'
Original file line number Diff line number Diff line change 1+ import { sanitizeFileName } from './sanitizeFileName.js'
2+
3+ /**
4+ * Transforms a path to a file name, replacing slashes with underscores
5+ */
6+ export const transformPathToFileName = ( rawPath : string ) : string =>
7+ sanitizeFileName ( rawPath . replace ( / \/ / g, '_' ) )
You can’t perform that action at this time.
0 commit comments