fix(build): use last hash file name in client manifest (#123)

This commit is contained in:
Xin Du (Clark) 2021-01-20 19:04:47 +00:00 committed by GitHub
parent 3d06693f88
commit 8e320f80aa

View File

@ -7,7 +7,6 @@ import { dirname } from 'path'
import hash from 'hash-sum'
import uniq from 'lodash/uniq'
import { writeFile, mkdirp } from 'fs-extra'
import { Compilation } from 'webpack'
import { isJS, isCSS } from './util'
@ -23,11 +22,7 @@ export default class VueSSRClientPlugin {
}
apply (compiler) {
compiler.hooks.make.tap('VueSSRClientPlugin', (compilation: any) => {
compilation.hooks.processAssets.tapAsync({
name: 'VueSSRClientPlugin',
stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
}, async (_assets, cb) => {
compiler.hooks.afterEmit.tap('VueSSRClientPlugin', async (compilation: any) => {
const stats = compilation.getStats().toJson()
const allFiles = uniq(stats.assets
@ -118,9 +113,6 @@ export default class VueSSRClientPlugin {
// source: () => src,
// size: () => src.length
// }
cb()
})
})
}
}