add isExternalURL

fixCompilationTargets
yann300 4 years ago
parent a7465b5623
commit e160cdd9a6
  1. 11
      apps/remix-ide/src/app/compiler/compiler-imports.js

@ -14,7 +14,7 @@ const profile = {
name: 'contentImport', name: 'contentImport',
displayName: 'content import', displayName: 'content import',
version: packageJson.version, version: packageJson.version,
methods: ['resolve', 'resolveAndSave'] methods: ['resolve', 'resolveAndSave', 'isExternalUrl']
} }
module.exports = class CompilerImports extends Plugin { module.exports = class CompilerImports extends Plugin {
@ -105,6 +105,15 @@ module.exports = class CompilerImports extends Plugin {
return /^([^/]+)/.exec(url) return /^([^/]+)/.exec(url)
} }
isExternalUrl (url) {
for (const handler of this.handlers()) {
if (handler.match.exec(url)) {
return true
}
}
return false
}
/** /**
* resolve the content of @arg url. This only resolves external URLs. * resolve the content of @arg url. This only resolves external URLs.
* *

Loading…
Cancel
Save