docusaurus/admin/testing-changes-on-Docusaurus-itself.md
William Poetra Yoga 30cf744544
docs(admin): update repo testing instructions to reflect v2 (#5845)
* docs: add some details (trivial)

* docs: add easier method (using yarn) to test local repo

* docs: add additional note

* Edits

* Update

Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
2021-11-27 16:21:48 +08:00

1.5 KiB

If you are developing the Docusaurus core and you want a quick way to test your changes, you can use the Docusaurus website itself as your testing area.

For tips on testing other projects, see the local testing of third-party projects doc.

Testing

It is straightforward to test your Docusaurus changes with Docusaurus.

cd /path/to/docusaurus-repo
yarn install
cd website
yarn start

Debugging Locally

VS Code

Use the following code in VSCode to enable breakpoints. Please ensure you have a later version of node for non-legacy debugging.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Docusaurus Start (Debug)",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceFolder}/website",
      "program": "${workspaceFolder}/website/node_modules/@docusaurus/core/bin/docusaurus.js",
      "args": ["start"]
    }
  ]
}

Other Editors

Feel free to contribute debug instructions for other IDEs

Observing changes

Note that since most packages are built with TypeScript, you would need to compile them every time to see the effect. Alternatively, you can run yarn watch inside the package directory to start an incremental build. Now that the server is running, you can make changes to the core Docusaurus code and docs to see the effects on the Docusaurus site. LiveReload will reflect changes to the local site in your browser, usually running at http://localhost:3000.