mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
misc: remove useless codes
This commit is contained in:
parent
fceb30b7a3
commit
dbba872be2
@ -35,7 +35,7 @@ export default class ModuleContainer {
|
|||||||
const src = template.src || template
|
const src = template.src || template
|
||||||
const srcPath = path.parse(src)
|
const srcPath = path.parse(src)
|
||||||
/* istanbul ignore if */
|
/* 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)
|
throw new Error('Template src not found:' + src)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,6 @@ export default class Renderer {
|
|||||||
useMiddleware(m) {
|
useMiddleware(m) {
|
||||||
// Resolve
|
// Resolve
|
||||||
const $m = m
|
const $m = m
|
||||||
let src
|
|
||||||
if (typeof m === 'string') {
|
if (typeof m === 'string') {
|
||||||
m = this.nuxt.requireModule(m)
|
m = this.nuxt.requireModule(m)
|
||||||
}
|
}
|
||||||
@ -185,8 +184,6 @@ export default class Renderer {
|
|||||||
(typeof m.path === 'string' ? m.path : '')
|
(typeof m.path === 'string' ? m.path : '')
|
||||||
).replace(/\/\//g, '/')
|
).replace(/\/\//g, '/')
|
||||||
|
|
||||||
// Inject $src and $m to final handler
|
|
||||||
if (src) handler.$src = src
|
|
||||||
handler.$m = $m
|
handler.$m = $m
|
||||||
|
|
||||||
// Use middleware
|
// Use middleware
|
||||||
|
Loading…
Reference in New Issue
Block a user