Merge branch 'dev' into feat/esm

This commit is contained in:
Pooya Parsa 2018-03-16 23:22:21 +03:30
commit 763f1163f6

View File

@ -24,14 +24,7 @@ export const validate = compiler => {
export const onEmit = (compiler, name, hook) => {
if (compiler.hooks) {
// Webpack >= 4.0.0
compiler.hooks.emit.tap(name,
(compilation) => new Promise((resolve, reject) => {
try {
hook(compilation, resolve)
} catch (e) {
reject(e)
}
}))
compiler.hooks.emit.tapAsync(name, hook)
} else {
// Webpack < 4.0.0
compiler.plugin('emit', hook)