minor requireModule fix

This commit is contained in:
Pooya Parsa 2017-05-21 20:42:28 +04:30
parent 04d3a22212
commit 7e57f55a5a

View File

@ -80,6 +80,7 @@ class Module {
if (this.modules.indexOf(moduleOpts) !== -1 || this.modules.indexOf(moduleOpts.src) !== -1) { if (this.modules.indexOf(moduleOpts) !== -1 || this.modules.indexOf(moduleOpts.src) !== -1) {
return false return false
} }
this.modules.push(moduleOpts.src || moduleOpts)
return this.addModule(moduleOpts) return this.addModule(moduleOpts)
} }
@ -116,8 +117,6 @@ class Module {
console.error('[Nuxt] Module should be a function', module) console.error('[Nuxt] Module should be a function', module)
process.exit(0) process.exit(0)
} }
// Add module to this.modules
this.modules.push(module)
// Call module with `this` context and pass options // Call module with `this` context and pass options
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const result = module.call(this, options, err => { const result = module.call(this, options, err => {