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