mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-29 22:47:52 +02:00
refactor(pwa): simplify registerSW code, fix ESLint errors (#7579)
This commit is contained in:
parent
bada5c11cc
commit
7869e74fd7
14 changed files with 204 additions and 247 deletions
|
@ -34,19 +34,19 @@ cli
|
|||
.option('--mdx', 'try to migrate MD to MDX too')
|
||||
.option('--page', 'try to migrate pages too')
|
||||
.description('Migrate between versions of Docusaurus website.')
|
||||
.action((siteDir = '.', newDir = '.', {mdx, page} = {}) => {
|
||||
.action(async (siteDir = '.', newDir = '.', {mdx, page} = {}) => {
|
||||
const sitePath = path.resolve(siteDir);
|
||||
const newSitePath = path.resolve(newDir);
|
||||
migrateDocusaurusProject(sitePath, newSitePath, mdx, page);
|
||||
await migrateDocusaurusProject(sitePath, newSitePath, mdx, page);
|
||||
});
|
||||
|
||||
cli
|
||||
.command('mdx [siteDir] [newDir]')
|
||||
.description('Migrate markdown files to MDX.')
|
||||
.action((siteDir = '.', newDir = '.') => {
|
||||
.action(async (siteDir = '.', newDir = '.') => {
|
||||
const sitePath = path.resolve(siteDir);
|
||||
const newSitePath = path.resolve(newDir);
|
||||
migrateMDToMDX(sitePath, newSitePath);
|
||||
await migrateMDToMDX(sitePath, newSitePath);
|
||||
});
|
||||
|
||||
cli.parse(process.argv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue