mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nitro): improve externals error handling (#1188)
This commit is contained in:
parent
47c004ac97
commit
80883cfb8f
@ -52,8 +52,12 @@ export function externals (opts: NodeExternalsOptions): Plugin {
|
|||||||
|
|
||||||
// Track externals
|
// Track externals
|
||||||
if (opts.trace !== false) {
|
if (opts.trace !== false) {
|
||||||
const resolved = await this.resolve(originalId, importer, { ...options, skipSelf: true }).then(r => r.id)
|
const resolved = await this.resolve(originalId, importer, { ...options, skipSelf: true })
|
||||||
trackedExternals.add(resolved)
|
if (!resolved) {
|
||||||
|
console.warn(`Could not resolve \`${originalId}\`. Have you installed it?`)
|
||||||
|
} else {
|
||||||
|
trackedExternals.add(resolved.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user