Skip to content

Commit 89538fa

Browse files
committed
feat: vuepress eject for customizing default theme
1 parent b3e1e5e commit 89538fa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

bin/vuepress.js

+11
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ program
3838
wrapCommand(build)(path.resolve(dir), { debug, outDir })
3939
})
4040

41+
program
42+
.command('eject [targetDir]')
43+
.description('copy the default theme into .vuepress/theme for customization.')
44+
.action(async (dir = '.') => {
45+
const { copy } = require('fs-extra')
46+
const source = path.resolve(__dirname, '../lib/default-theme')
47+
const target = path.resolve(dir, '.vuepress/theme')
48+
await copy(source, target)
49+
console.log(`Copied default theme into ${chalk.cyan(target)}.`)
50+
})
51+
4152
// output help information on unknown commands
4253
program
4354
.arguments('<command>')

0 commit comments

Comments
 (0)