Skip to content

Commit

Permalink
fix: ensure that injected plugin is inserted first
Browse files Browse the repository at this point in the history
closes #406
  • Loading branch information
danielroe committed Mar 20, 2021
1 parent b60da3a commit 5cd13bc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ const compositionApiModule: Module<never> = function compositionApiModule() {
corejsPolyfill: resolveCoreJsVersion.call(this),
})

// Global plugin to allow running onGlobalSetup
// Plugin to allow running onGlobalSetup
const globalPlugin = addResolvedTemplate.call(this, 'templates/plugin.js')

nuxtOptions.plugins.unshift(
addResolvedTemplate.call(this, 'templates/plugin.js')
)
this.nuxt.hook('modules:done', () => {
nuxtOptions.plugins.unshift(globalPlugin)
})

// TODO: remove
// Allow setting head() within onGlobalSetup
Expand Down

1 comment on commit 5cd13bc

@vercel
Copy link

@vercel vercel bot commented on 5cd13bc Mar 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.