fix(webpack): modern build should wait for legacy assets (#7635)

#7562
This commit is contained in:
Xin Du (Clark) 2020-06-29 16:44:08 +01:00 committed by GitHub
parent ffb340cc5c
commit 23324b9eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,15 +35,15 @@ export default class ModernModePlugin {
}
getAssets (name) {
const asset = this.assets[name]
if (!asset) {
return
}
return new Promise((resolve) => {
watcher.once(name, () => {
const asset = this.assets[name]
if (asset) {
return resolve(asset)
}
return watcher.once(name, () => {
const asset = this.assets[name]
return asset && resolve(asset)
})
return asset && resolve(asset)
})
}