From 113c3b668fde5f746a6ba3152a6f8394f26fdc46 Mon Sep 17 00:00:00 2001 From: nan Date: Tue, 21 Apr 2026 13:02:10 +0800 Subject: [PATCH] feat: Update asset paths and improve file handling in VitePress exporter --- src/main.ts | 8 +++----- src/settings.ts | 2 +- tsconfig.json | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index 1f26603..8f8d3d6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -186,6 +186,9 @@ export default class VitePressExporterPlugin extends Plugin { } } + const activeLeaf = this.app.workspace.getLeaf(); + await activeLeaf.openFile(sourceFile); + // 复制资源文件到 docs/assets for (const assetPath of assetsToCopy) { try { @@ -278,11 +281,6 @@ export default class VitePressExporterPlugin extends Plugin { ): Promise { const activeLeaf = this.app.workspace.getLeaf(); - if (!activeLeaf) { - console.log('❌ No active leaf found'); - return null; - } - await activeLeaf.openFile(canvasFile); //@ts-ignore diff --git a/src/settings.ts b/src/settings.ts index 06ea253..6e1cb5f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -8,7 +8,7 @@ export interface VitePressExporterSettings { export const DEFAULT_SETTINGS: VitePressExporterSettings = { docsPath: 'docs', - assetsPath: 'docs/assets' + assetsPath: 'docs/public' } // 设置面板 diff --git a/tsconfig.json b/tsconfig.json index 222535d..45b1c4f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "ignoreDeprecations": "6.0", "baseUrl": "src", "inlineSourceMap": true, "inlineSources": true,