mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
feat: enable custom theme with eject
This commit is contained in:
parent
8c6bc6dd38
commit
2b5ee3e869
6 changed files with 40 additions and 7 deletions
|
@ -4,7 +4,7 @@ const chalk = require('chalk');
|
|||
const semver = require('semver');
|
||||
const path = require('path');
|
||||
const program = require('commander');
|
||||
const {build, init, start} = require('../lib');
|
||||
const {build, eject, init, start} = require('../lib');
|
||||
const requiredVersion = require('../package.json').engines.node;
|
||||
|
||||
if (!semver.satisfies(process.version, requiredVersion)) {
|
||||
|
@ -42,6 +42,13 @@ program
|
|||
wrapCommand(build)(path.resolve(siteDir), {skipImageCompression});
|
||||
});
|
||||
|
||||
program
|
||||
.command('eject [siteDir]')
|
||||
.description('copy the default theme into website folder for customization.')
|
||||
.action((siteDir = '.') => {
|
||||
wrapCommand(eject)(path.resolve(siteDir));
|
||||
});
|
||||
|
||||
program
|
||||
.command('init [projectDir]')
|
||||
.description('Initialize website')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue