Skip to content

Commit cab1b15

Browse files
committed
avoid swallowing webpack error when entry is not found (fix vuejs#5553)
1 parent 2a1f79d commit cab1b15

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/server/webpack-plugin/server.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ export default class VueSSRServerPlugin {
1313
compiler.plugin('emit', (compilation, cb) => {
1414
const stats = compilation.getStats().toJson()
1515
const entryName = Object.keys(stats.entrypoints)[0]
16-
const entryAssets = stats.entrypoints[entryName].assets.filter(isJS)
16+
const entryInfo = stats.entrypoints[entryName]
17+
18+
if (!entryInfo) {
19+
// #5553
20+
return cb()
21+
}
22+
23+
const entryAssets = entryInfo.assets.filter(isJS)
1724

1825
if (entryAssets.length > 1) {
1926
throw new Error(

0 commit comments

Comments
 (0)