fix(core): avoid breaking change for duplicate modules (resolves #7605)

This commit is contained in:
pooya parsa 2020-06-25 14:34:31 +02:00
parent 415d4083ca
commit d0056fbcc8
1 changed files with 6 additions and 1 deletions

View File

@ -194,7 +194,12 @@ export default class ModuleContainer {
const key = (handler.meta && handler.meta.name) || src
if (typeof key === 'string') {
if (this.requiredModules[key]) {
return
if (key === src) {
// TODO: Skip with nuxt3
consola.warn('Modules should be only specified once:', key)
} else {
return
}
}
this.requiredModules[key] = { src, options, handler }
}