diff --git a/src/api/API.ts b/src/api/API.ts index 2b29a6b..478337a 100644 --- a/src/api/API.ts +++ b/src/api/API.ts @@ -38,7 +38,13 @@ export class API { * @param path the vault relative path of the file to import */ public async importJs(path: string): Promise { - const fullPath = this.app.vault.adapter.getResourcePath(path); + let fullPath = this.app.vault.adapter.getResourcePath(path); + if (!fullPath.includes('?')) { + const scriptFile = this.app.metadataCache.getFirstLinkpathDest(path, "") + if (scriptFile) { + fullPath += '?' + scriptFile.stat.mtime + } + } return import(fullPath); }