fix(ssr): update ssr/client manifect after webpack v5 beta.30 (#48)

This commit is contained in:
Xin Du (Clark) 2020-09-21 09:48:33 +01:00 committed by GitHub
parent a9f3ccf099
commit db050fd0a2
2 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ export default class VueSSRClientPlugin {
const initialFiles = uniq(Object.keys(stats.entrypoints)
.map(name => stats.entrypoints[name].assets)
.reduce((assets, all) => all.concat(assets), [])
.reduce((files, entryAssets) => files.concat(entryAssets.map(entryAsset => entryAsset.name)), [])
.filter(file => isJS(file) || isCSS(file)))
const asyncFiles = allFiles
@ -70,7 +70,7 @@ export default class VueSSRClientPlugin {
const chunkGroup = namedChunkGroups[chunkName]
if (chunkGroup) {
for (const asset of chunkGroup.assets) {
filesSet.add(fileToIndex(asset))
filesSet.add(fileToIndex(asset.name))
}
}
}

View File

@ -29,7 +29,7 @@ export default class VueSSRServerPlugin {
return cb()
}
const entryAssets = entryInfo.assets.filter(isJS)
const entryAssets = entryInfo.assets.filter(asset => isJS(asset.name))
if (entryAssets.length > 1) {
throw new Error(
@ -39,14 +39,14 @@ export default class VueSSRServerPlugin {
}
const [entry] = entryAssets
if (!entry || typeof entry !== 'string') {
if (!entry || typeof entry.name !== 'string') {
throw new Error(
`Entry "${entryName}" not found. Did you specify the correct entry option?`
)
}
const bundle = {
entry,
entry: entry.name,
files: {},
maps: {}
}