fix(bridge): add modules with hooks after all other modules (#3239)

This commit is contained in:
Daniel Roe 2022-02-16 17:54:45 +00:00 committed by GitHub
parent 07c14b8704
commit 7c9b0a358d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ const ImportRewrites = {
vue: '@vue/composition-api'
}
export async function setupAutoImports () {
export function setupAutoImports () {
const nuxt = useNuxt()
nuxt.hook('autoImports:extend', (autoImports) => {
@ -39,5 +39,5 @@ export async function setupAutoImports () {
autoImports.push({ name: 'useNuxt2Meta', as: 'useNuxt2Meta', from: '#app' })
})
await installModule(autoImports)
nuxt.hook('modules:done', () => installModule(autoImports))
}

View File

@ -61,7 +61,7 @@ export default defineNuxtModule({
}
if (opts.vite) {
const viteModule = await import('./vite/module').then(r => r.default || r) as NuxtModule
await installModule(viteModule)
nuxt.hook('modules:done', () => installModule(viteModule))
}
if (opts.postcss8) {
await installModule(_require.resolve('@nuxt/postcss8'))