From 53e285ae43b3044c5f6a7f5ba4a7af5323a494ec Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 31 Jan 2023 12:17:54 +0100 Subject: [PATCH] clear the import cache --- libs/remix-core-plugin/src/lib/compiler-content-imports.ts | 1 + libs/remix-url-resolver/src/resolve.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/libs/remix-core-plugin/src/lib/compiler-content-imports.ts b/libs/remix-core-plugin/src/lib/compiler-content-imports.ts index 0d199a001f..30d31e054f 100644 --- a/libs/remix-core-plugin/src/lib/compiler-content-imports.ts +++ b/libs/remix-core-plugin/src/lib/compiler-content-imports.ts @@ -44,6 +44,7 @@ export class CompilerImports extends Plugin { return {} } }) + this.on('filePanel', 'setWorkspace', () => this.urlResolver.clearCache()) } async setToken () { diff --git a/libs/remix-url-resolver/src/resolve.ts b/libs/remix-url-resolver/src/resolve.ts index 135ff05b14..4abfd53bcb 100644 --- a/libs/remix-url-resolver/src/resolve.ts +++ b/libs/remix-url-resolver/src/resolve.ts @@ -42,6 +42,10 @@ export class RemixURLResolver { this.protocol = protocol } + clearCache () { + this.previouslyHandled = {} + } + /** * Handle an import statement based on github * @param root The root of the github import statement