Docusaurus provides a set of scripts to help you generate, serve, and deploy your website.
Once your website is generated, your website package will contain the Docusaurus scripts that you may invoke with your package manager:
Docusaurus CLI commands
Below is a list of Docusaurus CLI commands and their usages:
Builds and serves the static site with Webpack Dev Server.
|Specifies the port of the dev server|
|Specify a host to use. E.g., if you want your server to be accessible externally, you can use |
|Enables Hot Module Replacement without page refresh as fallback in case of build failures. More information here.|
|Do not open automatically the page in the browser.|
Compiles your site for production.
|Analyze your bundle with bundle analyzer|
⚠️ We would like to discourage swizzling of components until we've minimally reached a Beta stage. The components APIs have been changing rapidly and are likely to keep changing until we reach Beta. Stick with the default appearance for now if possible to save yourself some potential pain in future.
Swizzle any Docusaurus Theme components with your own component with
themeName: name of the theme you are using
swizzleComponent: name of the component to be swizzled
Running the above command will copy the relevant theme files to your site folder. You may then make any changes to it and Docusaurus will use it instead of the one provided from the theme.
To unswizzle a component, simply delete the files of the swizzled component.
To learn more about swizzling, check here.
Deploys your site with GitHub Pages.