avoid swallowing webpack error when entry is not found (fix #5553)

This commit is contained in:
Evan You 2017-04-30 12:44:23 +08:00
parent 2a1f79dfbe
commit cab1b151e2
1 changed files with 8 additions and 1 deletions

View File

@ -13,7 +13,14 @@ export default class VueSSRServerPlugin {
compiler.plugin('emit', (compilation, cb) => {
const stats = compilation.getStats().toJson()
const entryName = Object.keys(stats.entrypoints)[0]
const entryAssets = stats.entrypoints[entryName].assets.filter(isJS)
const entryInfo = stats.entrypoints[entryName]
if (!entryInfo) {
// #5553
return cb()
}
const entryAssets = entryInfo.assets.filter(isJS)
if (entryAssets.length > 1) {
throw new Error(