CLI(명령 줄 인터페이스)
도큐사우루스는 여러분의 웹 사이트를 만들고 확인하고 배포할 수 있게 도움을 주는 스크립트 모음을 제공합니다.
웹 사이트를 만들면 소스 안에 패키지 관리자를 호출할 수 있는 도큐사우루스 스크립트가 포함되어 있습니다.
package.json
{
// ...
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
}
}
Docusaurus CLI commands
도큐사우루스 CLI 명령과 사용법을 설명합니다.
docusaurus start [siteDir]
Builds and serves a preview of your site locally with Webpack Dev Server.
Options
옵션명 | 기본값 | 설명 |
---|---|---|
--port | 3000 | 개발 서버에서 사용할 포트를 설정합니다. |
--host | localhost | 사용할 호스트를 설정합니다. For example, if you want your server to be accessible externally, you can use --host 0.0.0.0 . |
--hot-only | false | 빌드 실패 시 폴백 처리로 페이지 새로고침 없이 빠른 모듈 교체(Hot Module Replacement)를 사용할지 여부를 설정합니다. More information here. |
--no-open | false | 웹 브라우저에서 자동으로 페이지를 열지 여부를 설정합니다. |
--config | undefined | Path to Docusaurus config file, default to [siteDir]/docusaurus.config.js |
--poll [optionalIntervalMs] | false | 변경 상태 체크가 제대로 되지 않을 때 폴백 처리로 라이브 리로드 대신 파일 폴링을 사용하도록 설정할 수 있습니다. More information here. |
--no-minify | false | JS/CSS 번들 최소화 없이 웹 사이트를 빌드할지 여부를 설정합니다. |
정보
일부 기능(앵커 링크 같은)은 개발 모드에서는 잘 동작하지 않을 수 있습니다. 하지만 제품 모드에서는 정상적으로 동작합니다.
Development over network
When forwarding port 3000 from a remote server or VM (e.g. GitHub Codespaces), you can run the dev server on 0.0.0.0
to make it listen on the local IP.
- npm
- Yarn
- pnpm
npm run start -- --host 0.0.0.0
yarn run start --host 0.0.0.0
pnpm run start --host 0.0.0.0
Enabling HTTPS
인증서를 받는 방법은 여러 가지가 있습니다. We will use mkcert as an example.
-
Run
mkcert localhost
to generatelocalhost.pem
+localhost-key.pem
-
Run
mkcert -install
to install the cert in your trust store, and restart your browser -
HTTPS 환경 변수를 설정하고 도큐사우루스 앱을 실행합니다.
HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem yarn start
- Open
https://localhost:3000/