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) const initialFiles = uniq(Object.keys(stats.entrypoints)
.map(name => stats.entrypoints[name].assets) .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))) .filter(file => isJS(file) || isCSS(file)))
const asyncFiles = allFiles const asyncFiles = allFiles
@ -70,7 +70,7 @@ export default class VueSSRClientPlugin {
const chunkGroup = namedChunkGroups[chunkName] const chunkGroup = namedChunkGroups[chunkName]
if (chunkGroup) { if (chunkGroup) {
for (const asset of chunkGroup.assets) { 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() return cb()
} }
const entryAssets = entryInfo.assets.filter(isJS) const entryAssets = entryInfo.assets.filter(asset => isJS(asset.name))
if (entryAssets.length > 1) { if (entryAssets.length > 1) {
throw new Error( throw new Error(
@ -39,14 +39,14 @@ export default class VueSSRServerPlugin {
} }
const [entry] = entryAssets const [entry] = entryAssets
if (!entry || typeof entry !== 'string') { if (!entry || typeof entry.name !== 'string') {
throw new Error( throw new Error(
`Entry "${entryName}" not found. Did you specify the correct entry option?` `Entry "${entryName}" not found. Did you specify the correct entry option?`
) )
} }
const bundle = { const bundle = {
entry, entry: entry.name,
files: {}, files: {},
maps: {} maps: {}
} }