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

View File

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