mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Merge branch 'dev' into feat/esm
This commit is contained in:
commit
763f1163f6
@ -24,14 +24,7 @@ export const validate = compiler => {
|
|||||||
export const onEmit = (compiler, name, hook) => {
|
export const onEmit = (compiler, name, hook) => {
|
||||||
if (compiler.hooks) {
|
if (compiler.hooks) {
|
||||||
// Webpack >= 4.0.0
|
// Webpack >= 4.0.0
|
||||||
compiler.hooks.emit.tap(name,
|
compiler.hooks.emit.tapAsync(name, hook)
|
||||||
(compilation) => new Promise((resolve, reject) => {
|
|
||||||
try {
|
|
||||||
hook(compilation, resolve)
|
|
||||||
} catch (e) {
|
|
||||||
reject(e)
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
} else {
|
} else {
|
||||||
// Webpack < 4.0.0
|
// Webpack < 4.0.0
|
||||||
compiler.plugin('emit', hook)
|
compiler.plugin('emit', hook)
|
||||||
|
Loading…
Reference in New Issue
Block a user