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 85c811ef91..b64308ff34 100644 --- a/libs/remix-core-plugin/src/lib/compiler-content-imports.ts +++ b/libs/remix-core-plugin/src/lib/compiler-content-imports.ts @@ -48,7 +48,18 @@ export class CompilerImports extends Plugin { } onActivation(): void { + const packageFiles = ['package.json', 'package-lock.json', 'yarn.lock'] this.on('filePanel', 'setWorkspace', () => this.urlResolver.clearCache()) + this.on('fileManager', 'fileRemoved', (file: string) => { + if (packageFiles.includes(file)) { + this.urlResolver.clearCache() + } + }) + this.on('fileManager', 'fileChanged', (file: string) => { + if (packageFiles.includes(file)) { + this.urlResolver.clearCache() + } + }) } async setToken () { diff --git a/libs/remix-url-resolver/src/resolve.ts b/libs/remix-url-resolver/src/resolve.ts index aba4213bcf..850e2015ab 100644 --- a/libs/remix-url-resolver/src/resolve.ts +++ b/libs/remix-url-resolver/src/resolve.ts @@ -179,7 +179,6 @@ export class RemixURLResolver { } const req = 'https://unpkg.com/' + url const response: AxiosResponse = await axios.get(req, { transformResponse: [] }) - console.log('handleNpmImport', req) return { content: response.data, cleanUrl: url } } catch (e) { throw e