misc: remove useless codes

This commit is contained in:
Clark Du 2018-08-03 16:06:18 +01:00
parent fceb30b7a3
commit dbba872be2
No known key found for this signature in database
GPG Key ID: 32CBD8CD478AF898
2 changed files with 1 additions and 4 deletions

View File

@ -35,7 +35,7 @@ export default class ModuleContainer {
const src = template.src || template
const srcPath = path.parse(src)
/* istanbul ignore if */
if (!src || typeof src !== 'string' || !fs.existsSync(src)) {
if (typeof src !== 'string' || !fs.existsSync(src)) {
throw new Error('Template src not found:' + src)
}

View File

@ -171,7 +171,6 @@ export default class Renderer {
useMiddleware(m) {
// Resolve
const $m = m
let src
if (typeof m === 'string') {
m = this.nuxt.requireModule(m)
}
@ -185,8 +184,6 @@ export default class Renderer {
(typeof m.path === 'string' ? m.path : '')
).replace(/\/\//g, '/')
// Inject $src and $m to final handler
if (src) handler.$src = src
handler.$m = $m
// Use middleware