Skip to content

Commit

Permalink
Add a simple plugin to playground for hook testing
Browse files Browse the repository at this point in the history
  • Loading branch information
brawaru committed Nov 23, 2023
1 parent cdc3739 commit a785658
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ export default defineNuxtConfig({
},
onParseError: 'log-and-skip',
},
plugins: [
{
src: './plugins/test.ts',
order: -100,
},
],
})
9 changes: 9 additions & 0 deletions apps/playground/plugins/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('i18n:extendLocale', ({ event }) => {
console.log('[vintl] loading locale', event.locale.tag)
})

nuxtApp.hook('i18n:ready', () => {
console.log('[vintl] ready')
})
})

0 comments on commit a785658

Please sign in to comment.