clear cache

pull/3311/head
bunsenstraat 2 years ago
parent 00e3baa70a
commit 05b7d1aed1
  1. 11
      libs/remix-core-plugin/src/lib/compiler-content-imports.ts
  2. 1
      libs/remix-url-resolver/src/resolve.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 () {

@ -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

Loading…
Cancel
Save