Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ignored plugin option cleanOutputDir #296

Merged
merged 1 commit into from Feb 24, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-typedoc/package.json
@@ -1,6 +1,6 @@
{
"name": "docusaurus-plugin-typedoc",
"version": "0.17.0",
"version": "0.17.1",
"description": "A Docusaurus v2 plugin to build API documentation with TypeDoc.",
"main": "dist/index.js",
"files": [
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-typedoc/src/options.ts
Expand Up @@ -4,6 +4,7 @@ const DEFAULT_PLUGIN_OPTIONS: PluginOptions = {
id: 'default',
docsRoot: 'docs',
out: 'api',
cleanOutputDir: true,
sidebar: {
fullNames: false,
categoryLabel: 'API',
Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus-plugin-typedoc/src/plugin.ts
Expand Up @@ -27,7 +27,9 @@ export default function pluginDocusaurus(

const outputDir = path.resolve(siteDir, options.docsRoot, options.out);

removeDir(outputDir);
if (opts.cleanOutputDir) {
removeDir(outputDir);
}

const app = new Application();

Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-typedoc/src/types.ts
Expand Up @@ -8,6 +8,7 @@ export interface PluginOptions {
plugin: string[];
readme?: string;
disableOutputCheck?: boolean;
cleanOutputDir?: boolean;
entryPoints?: string[];
watch: boolean;
hideInPageTOC: boolean;
Expand Down
Expand Up @@ -18,6 +18,7 @@ Array [

exports[`Options: should return default options 1`] = `
Object {
"cleanOutputDir": true,
"docsRoot": "docs",
"entryDocument": "index.md",
"entryPoints": Array [
Expand Down