解决编译后加载顺序异常的went
This commit is contained in:
parent
699297877a
commit
00006ed146
@ -38,9 +38,6 @@ module.exports = app => {
|
|||||||
template,
|
template,
|
||||||
clientManifest
|
clientManifest
|
||||||
})
|
})
|
||||||
const API = require('../dist/api/api').default
|
|
||||||
const server = API(app)
|
|
||||||
resolve(server)
|
|
||||||
} else {
|
} else {
|
||||||
// dev mode
|
// dev mode
|
||||||
setUpDevServer(app, (bundle, options, apiMain, apiOutDir) => {
|
setUpDevServer(app, (bundle, options, apiMain, apiOutDir) => {
|
||||||
@ -54,6 +51,7 @@ module.exports = app => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
app.use(async (ctx, next) => {
|
app.use(async (ctx, next) => {
|
||||||
if (!renderer) {
|
if (!renderer) {
|
||||||
ctx.type = 'html'
|
ctx.type = 'html'
|
||||||
@ -92,5 +90,11 @@ module.exports = app => {
|
|||||||
ctx.body = html
|
ctx.body = html
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (isProd) {
|
||||||
|
const API = require('../dist/api/api').default
|
||||||
|
const server = API(app)
|
||||||
|
resolve(server)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user