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