mirror of
https://github.com/motion-canvas/motion-canvas.git
synced 2026-01-13 07:48:03 -05:00
feat(docs): always re-build api references in build mode (#298)
Before the API References did not get re-build when running `npm run docs:build` which caused some confusion. **Explanation** One can check if `docusaurus` runs in `build` mode using the `NODE_ENV` environment variable which will be set to `production` if that's the case. If the variable is set we ignore previously build files and re-build them including the `api.json`. Closes: #294
This commit is contained in:
@@ -16,7 +16,7 @@ module.exports = () => ({
|
||||
name: 'docusaurus-typedoc-plugin',
|
||||
async loadContent() {
|
||||
const dir = './src/generated';
|
||||
if (fs.existsSync(dir)) {
|
||||
if (fs.existsSync(dir) && process.env.NODE_ENV !== 'production') {
|
||||
const api = JSON.parse(
|
||||
await fs.promises.readFile(`${dir}/api.json`, 'utf8'),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user