diff --git a/packages/icon/index.js b/packages/icon/index.js index 1bc7d4f5..6d1c155c 100755 --- a/packages/icon/index.js +++ b/packages/icon/index.js @@ -16,7 +16,7 @@ module.exports = function nuxtIcon (options) { return hook() } - this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook) + this.nuxt.hook('build:before', hook) } function generateIcons (moduleOptions) { diff --git a/packages/manifest/index.js b/packages/manifest/index.js index cf9ea904..ec86b1ce 100755 --- a/packages/manifest/index.js +++ b/packages/manifest/index.js @@ -15,7 +15,7 @@ module.exports = function nuxtManifest (options) { return hook() } - this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook) + this.nuxt.hook('build:before', hook) } function addManifest (options) { diff --git a/packages/meta/index.js b/packages/meta/index.js index 7961a852..a91b6697 100755 --- a/packages/meta/index.js +++ b/packages/meta/index.js @@ -12,7 +12,7 @@ module.exports = function nuxtMeta (_options) { return hook() } - this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook) + this.nuxt.hook('build:before', hook) } function generateMeta (_options) { diff --git a/packages/onesignal/index.js b/packages/onesignal/index.js index 7973dfbe..2e6cce09 100755 --- a/packages/onesignal/index.js +++ b/packages/onesignal/index.js @@ -21,7 +21,7 @@ module.exports = function nuxtOneSignal (moduleOptions) { return hook() } - this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook) + this.nuxt.hook('build:before', hook) } // ============================================= diff --git a/packages/workbox/index.js b/packages/workbox/index.js index 0344ffc2..7d8b0b47 100755 --- a/packages/workbox/index.js +++ b/packages/workbox/index.js @@ -43,7 +43,7 @@ module.exports = function nuxtWorkbox (moduleOptions) { } }) - this.nuxt.hook ? this.nuxt.hook('build:before', hook) : this.nuxt.plugin('build', hook) + this.nuxt.hook('build:before', hook) } // ============================================= @@ -198,13 +198,7 @@ function emitAssets (options) { }) } - if (this.nuxt.hook) { - this.nuxt.hook('build:done', hook) - } else { - this.nuxt.plugin('build', builder => { - builder.plugin('built', hook) - }) - } + this.nuxt.hook('build:done', hook) // workbox.js let wbPath = require.resolve('workbox-sw') @@ -227,13 +221,7 @@ function workboxInject (options) { return swBuild.injectManifest(opts) } - if (this.nuxt.hook) { - this.nuxt.hook('build:done', hook) - } else { - this.nuxt.plugin('build', builder => { - builder.plugin('built', hook) - }) - } + this.nuxt.hook('build:done', hook) } // =============================================