clear cache

pull/5370/head
bunsenstraat 2 years ago
parent a850975b89
commit a910bacdfa
  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 { onActivation(): void {
const packageFiles = ['package.json', 'package-lock.json', 'yarn.lock']
this.on('filePanel', 'setWorkspace', () => this.urlResolver.clearCache()) 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 () { async setToken () {

@ -179,7 +179,6 @@ export class RemixURLResolver {
} }
const req = 'https://unpkg.com/' + url const req = 'https://unpkg.com/' + url
const response: AxiosResponse = await axios.get(req, { transformResponse: [] }) const response: AxiosResponse = await axios.get(req, { transformResponse: [] })
console.log('handleNpmImport', req)
return { content: response.data, cleanUrl: url } return { content: response.data, cleanUrl: url }
} catch (e) { } catch (e) {
throw e throw e

Loading…
Cancel
Save