Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/docusaurus/src/commands/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ export async function createCLIProgram({
'--no-minify',
'build website without minimizing JS bundles (default: false)',
)
/*
TODO
.option(
'--https',
'serve the dev site over HTTPS using a self-signed cert (default: false). Preferred over the HTTPS=true env var. Implied when both --ssl-cert and --ssl-key are provided.',
Expand All @@ -217,7 +215,6 @@ export async function createCLIProgram({
'--ssl-key <path>',
'path to a TLS private key file (implies HTTPS). Preferred over the SSL_KEY_FILE env var; CLI takes precedence if both are set.',
)
*/
.action(start);

cli
Expand Down
4 changes: 0 additions & 4 deletions packages/docusaurus/src/commands/start/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ export type StartCLIOptions = HostPortOptions &
open?: boolean;
poll?: boolean | number;
minify?: boolean;

/*
TODO Docusaurus v4: wire new CLI parameters
https?: true;
sslCert?: string;
sslKey?: string;
*/
};

async function doStart(
Expand Down
4 changes: 0 additions & 4 deletions packages/docusaurus/src/commands/start/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,9 @@ async function createDevServerConfig({
const pollingOptions = createPollingOptions(cliOptions);

const httpsConfig = await getHttpsConfig({
/*
TODO Docusaurus v4: wire new CLI parameters
https: cliOptions.https,
sslCert: cliOptions.sslCert,
sslKey: cliOptions.sslKey,

*/
});

// https://webpack.js.org/configuration/dev-server
Expand Down
19 changes: 16 additions & 3 deletions website/docs/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Builds and serves a preview of your site locally with [Webpack Dev Server](https
| `--config` | `undefined` | Path to Docusaurus config file, default to `[siteDir]/docusaurus.config.js` |
| `--poll [optionalIntervalMs]` | `false` | Use polling of files rather than watching for live reload as a fallback in environments where watching doesn't work. More information [here](https://webpack.js.org/configuration/watch/#watchoptionspoll). |
| `--no-minify` | `false` | Build website without minimizing JS/CSS bundles. |
| `--https` | `false` | Serve the dev site over HTTPS using a self-signed certificate. Implied when both `--ssl-cert` and `--ssl-key` are provided. |
| `--ssl-cert` | `undefined` | Path to a TLS certificate file (implies HTTPS). |
| `--ssl-key` | `undefined` | Path to a TLS private key file (implies HTTPS). |

:::info

Expand All @@ -70,14 +73,24 @@ There are multiple ways to obtain a certificate. We will use [mkcert](https://gi

2. Run `mkcert -install` to install the cert in your trust store, and restart your browser

3. Start the app with Docusaurus HTTPS env variables:
3. Start the app with the Docusaurus HTTPS CLI options:

```bash
HTTPS=true SSL_CRT_FILE=localhost.pem SSL_KEY_FILE=localhost-key.pem yarn start
```bash npm2yarn
npm run start -- --ssl-cert localhost.pem --ssl-key localhost-key.pem
```

4. Open `https://localhost:3000/`

:::tip Self-signed certificate

Use the `--https` option to serve the dev site over HTTPS with an automatically generated self-signed certificate:

```bash npm2yarn
npm run start -- --https
```

:::

### `docusaurus build [siteDir]` {/* #docusaurus-build-sitedir */}

Compiles your site for production.
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4263,7 +4263,7 @@
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.15.40.tgz#3563f7e8ce8708f5fda43eb8e0956ef11e0da320"
integrity sha512-OXtKsLU1bVtInzzDEAY2sYiF/rl4tvAnLLLpuMp3HzAOQZ5A+i69AKDhA1YLQTaMAqO3vzyYNVAYVRMPtSYD4w==

"@swc/core@^1.15.32", "@swc/core@^1.15.40":
"@swc/core@^1.15.40":
version "1.15.40"
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.15.40.tgz#941c949aa88c0d8d291f102f519f3c2c77701b90"
integrity sha512-2kwzJikRvgtNAG7MwVZY2vEzZjTxKIq5jXOihuSV/8U+Hej8Va22t65aKnJZs3P+NwojZvR8Mf8kyM7O+V8sQg==
Expand Down
Loading