Skip to content

Commit 3c586ca

Browse files
committed
docs(nuxt): add warning in dev mode suggesting #imports
1 parent f863f3f commit 3c586ca

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/nuxt/src/app/composables/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ export type { NuxtAppManifest, NuxtAppManifestMeta } from './manifest'
3434
export type { ReloadNuxtAppOptions } from './chunk'
3535
export { reloadNuxtApp } from './chunk'
3636
export { useRequestURL } from './url'
37+
38+
if (import.meta.dev) {
39+
console.log('Directly importing from `#app/composables` is discouraged as it can decrease performance in Vite. Instead, you can import from `#imports`. You can read more at https://nuxt.com/docs/guide/concepts/auto-imports#explicit-imports.')
40+
}

packages/nuxt/src/app/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ export type { PageMeta } from '../pages/runtime/index'
1313

1414
export const isVue2 = false
1515
export const isVue3 = true
16+
17+
if (import.meta.dev) {
18+
console.log('Directly importing from `#app` is discouraged as it can decrease performance in Vite. Instead, you can import from `#imports`. You can read more at https://nuxt.com/docs/guide/concepts/auto-imports#explicit-imports.')
19+
}

0 commit comments

Comments
 (0)