Merge branch 'resolve_with_package' of https://github.com/ethereum/remix-project into resolve_with_package

pull/3311/head
filip mertens 2 years ago
commit e7d43469df
  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