fix(ssr): add debug
This commit is contained in:
parent
8cb4189b96
commit
6b9e0922cf
2 changed files with 4 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import { isAbsolutePath } from '../../src/core/router/util'
|
|||
import { readFileSync } from 'fs'
|
||||
import { resolve, basename } from 'path'
|
||||
import resolvePathname from 'resolve-pathname'
|
||||
import debug from 'debug'
|
||||
|
||||
function cwd (...args) {
|
||||
return resolve(process.cwd(), ...args)
|
||||
|
|
@ -112,10 +113,12 @@ export default class Renderer {
|
|||
}
|
||||
|
||||
async _loadFile (filePath) {
|
||||
debug('docsify')(`load > ${filePath}`)
|
||||
let content
|
||||
try {
|
||||
if (isAbsolutePath(filePath)) {
|
||||
const res = await fetch(filePath)
|
||||
if (!res.ok) throw Error()
|
||||
content = await res.text()
|
||||
this.lock = 0
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
"test": "echo 'hello'"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^2.6.8",
|
||||
"node-fetch": "^1.7.0",
|
||||
"resolve-pathname": "^2.1.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue