mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-11 14:26:35 +10:00
17 lines
538 B
JavaScript
17 lines
538 B
JavaScript
module.exports = (options, ctx) => {
|
|
const { pages } = ctx
|
|
// const componentNames = Object.keys(layoutComponentMap)
|
|
|
|
return {
|
|
name: '@vuepress/internal-page-components',
|
|
|
|
async clientDynamicModules () {
|
|
const code = `export default {\n${pages
|
|
.filter(({ _filePath }) => _filePath)
|
|
.map(({ key, _filePath }) => ` ${JSON.stringify(key)}: () => import(${JSON.stringify(_filePath)})`)
|
|
.join(',\n')} \n}`
|
|
return { name: 'page-components.js', content: code, dirname: 'internal' }
|
|
}
|
|
}
|
|
}
|