fix(core): only warn for duplicate module if metaKey is not specified

This commit is contained in:
pooya parsa 2020-06-25 16:52:40 +02:00
parent b0274357b3
commit b070e19a15

View File

@ -191,10 +191,11 @@ export default class ModuleContainer {
}
// Ensure module is required once
const key = (handler.meta && handler.meta.name) || src
const metaKey = handler.meta && handler.meta.name
const key = metaKey || src
if (typeof key === 'string') {
if (this.requiredModules[key]) {
if (key === src) {
if (!metaKey) {
// TODO: Skip with nuxt3
consola.warn('Modules should be only specified once:', key)
} else {