0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/.changeset/dry-moose-join.md
Nate Moore d25f54cb93
[Vue] add support for appEntrypoint (#5075)
* feat(vue): add support for appEntrypoint

* chore: add changeset

* test(vue): add tests for app entrypoint

* docs(vue): update README to include app entrypoint

* fix(vue): prefer resolvedVirtualModuleId

Co-authored-by: Nate Moore <nate@astro.build>
2022-10-13 14:15:57 -05:00

782 B

@astrojs/vue
minor

Add support for the appEntrypoint option, which accepts a root-relative path to an app entrypoint. The default export of this file should be a function that accepts a Vue App instance prior to rendering. This opens up the ability to extend the App instance with custom Vue plugins.

// astro.config.mjs
import { defineConfig } from 'astro/config';
import vue from '@astrojs/vue';

export default defineConfig({
  integrations: [
    vue({
      appEntrypoint: '/src/pages/_app'
    })
  ]
})
// src/pages/_app.ts
import type { App } from 'vue';
import i18nPlugin from '../plugins/i18n'

export default function setup(app: App) {
  app.use(i18nPlugin, { /* options */ })
}