<a href="https://www.npmjs.com/package/@nx-extend/docusaurus" rel="nofollow"> <img src="https://badgen.net/npm/v/@nx-extend/docusaurus" alt="@nx-extend/docusaurus NPM package"> </a>
npm install @nx-extend/docusaurusNx plugin for working with docusaurus.
- Prerequisite
- Getting Started
- Schematics (i.e. code generation)
- Builders (i.e. task runners)
- Troubleshooting
``npm
npm install @nx-extend/docusaurus --save-dev
$3
`
nx g @nx-extend/docusaurus:app my-app
`$3
`
nx serve my-app
`Schematics (i.e. code generation)
$3
nx g @nx-extend/docusaurus:app | Arguments | Description |
| --------- | --------------------- |
|
| The name of your app. || Options | Default | Description |
| -------------- | ------- | ------------------------------------------ |
|
--tags | - | Tags to use for linting (comma-delimited). |
| --directory | apps | A directory where the project is placed. |
| --skipFormat | false | Skip formatting files. |Builders (i.e. task runners)
$3
nx serve | Arguments | Description |
| --------- | --------------------- |
|
| The name of your app. || Options | Default | Description |
| ----------- | ----------- | ---------------------------------------------------- |
|
--port | 3000 | Use specified port. |
| --host | localhost | Use specified host. |
| --hotOnly | false | Do not fallback to page refresh if hot reload fails. |
| --open | false | Open page in the browser. |$3
nx build | Arguments | Description |
| --------- | --------------------- |
|
| The name of your app. || Options | Default | Description |
| ------------------ | ------- | ------------------------------------------------------------------------------ |
|
--bundleAnalyzer | false | Visualize size of webpack output files with an interactive zoomable treemap. |
| --outputPath | - | The full path for the new output directory, relative to the current workspace. |
| --minify | true | Build website minimizing JS bundles. |Troubleshooting
If you encounter this error while building a Docusaurus app, then you may need to add a
terser resolution to your package.json. Note: this only works with Yarn and not npm.Error:
`
Docusaurus user: you probably have this known error due to using a monorepo/workspace.
We have a workaround for you, check https://github.com/facebook/docusaurus/issues/3515
`package.json:
`
{
// ...
"resolutions": {
"terser": "^4.0.0"
}
// ...
}
`Once this has been updated, you should be able to run
yarn install` and then build your Docusaurus application.