๋ฉ”์ธ ์ปจํ…์ธ ๋กœ ์ด๋™
๋ฒ„์ „: 3.5.2

๐Ÿ“ฆ create-docusaurus

๋ฐ”๋กœ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค ์•ฑ์„ ์ฆ‰์‹œ ์„ค์ •ํ•˜๋Š”๋ฐ ๋„์›€์ด ๋˜๋Š” ์Šค์บํด๋”ฉ ์œ ํ‹ธ์ž…๋‹ˆ๋‹ค.

Usageโ€‹

npx create-docusaurus@latest [name] [template] [rootDir]

The name argument will be used as the site's path as well as the name field in the created app's package.json. It can be an absolute path, or a path relative to rootDir.

The template argument can be one of the following:

  • classic: Uses the classic template (recommended)
  • facebook: Uses the Facebook/Meta template, which contains some Meta-specific setup
  • A git repo URL (beginning with https:// or git@), which can be cloned to the destination
  • ์›ํ•˜๋Š” ๊ณณ์— ๋ณต์‚ฌํ•  ํŒŒ์ผ์ด ํฌํ•จ๋œ CWD์— ๋Œ€ํ•œ ๋กœ์ปฌ ํŒŒ์ผ ๊ฒฝ๋กœ

The rootDir will be used to resolve the absolute path to the site directory. ๊ธฐ๋ณธ๊ฐ’์€ CWD์ž…๋‹ˆ๋‹ค.

๊ฒฝ๊ณ 

์ด ๋ช…๋ น์€ ๋ชจ๋“  ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ๋Œ€ํ™”ํ˜• ์‰˜์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

Optionsโ€‹

-t, --typescriptโ€‹

ํ…œํ”Œ๋ฆฟ ์ธ์ˆ˜๊ฐ€ ์ธ์‹๋œ ์ด๋ฆ„์ผ ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. Currently, only classic provides a TypeScript variant.

-g, --git-strategyโ€‹

ํ…œํ”Œ๋ฆฟ ์ธ์ˆ˜๊ฐ€ ๊นƒ ์ €์žฅ์†Œ์ผ ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • deep: preserves full git history
  • shallow: clones with --depth=1
  • copy: does a shallow clone, but does not create a git repo
  • custom: enter your custom git clone command. ์ž…๋ ฅ์„ ์œ„ํ•œ ๊ฐ€์ด๋“œ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. You can write something like git clone --depth 10, and we will append the repository URL and destination directory.

-p, --package-managerโ€‹

Value should be one of npm, yarn, pnpm, or bun. ๋ช…์‹œ์ ์œผ๋กœ ๊ฐ’์„ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค๋Š” ๋‹ค์Œ ๊ธฐ์ค€์— ๋”ฐ๋ผ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

  • CWD์— ์ด๋ฏธ ์žˆ๋Š” lockfile(์˜ˆ: ๊ธฐ์กด ํ”„๋กœ์ ํŠธ์—์„œ ์›น์‚ฌ์ดํŠธ๋ฅผ ์„ค์ •ํ•˜๋Š” ๊ฒฝ์šฐ)
  • The command used to invoke create-docusaurus (e.g. npm init, npx, yarn create, bunx, etc.)
  • ์ด์ „์— ์‚ฌ์šฉํ•œ ์  ์—†๋Š” ๊ฒฝ์šฐ๋ผ๋ฉด ๋Œ€ํ™”ํ˜• ํ”„๋กฌํ”„ํŠธ

-s, --skip-installโ€‹

์˜ต์…˜์„ ์ง€์ •ํ•˜๋ฉด ๋„ํ์‚ฌ์šฐ๋ฃจ์Šค๋Š” ์•ฑ ์ƒ์„ฑ ํ›„ ์ข…์†์„ฑ์„ ์ž๋™์œผ๋กœ ์„ค์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. The --package-manager option is only useful when you are actually installing dependencies.