+
+ {{ a }}
+ {{ b }}
+ {{ c }}
+ {{ d }}
+ {{ foo }}
+
+
+
+
diff --git a/examples/with-composables/composables/use-foo.ts b/examples/with-composables/composables/use-foo.ts
new file mode 100644
index 0000000000..3550421ffe
--- /dev/null
+++ b/examples/with-composables/composables/use-foo.ts
@@ -0,0 +1,23 @@
+import { useState } from '#app'
+
+export function useA () {
+ return 'a'
+}
+
+function useB () {
+ return 'b'
+}
+
+function _useC () {
+ return 'c'
+}
+
+export const useD = () => {
+ return 'd'
+}
+
+export { useB, _useC as useC }
+
+export default function () {
+ return useState('foo', () => 'bar')
+}
diff --git a/examples/with-composables/nuxt.config.ts b/examples/with-composables/nuxt.config.ts
new file mode 100644
index 0000000000..a3e4d68096
--- /dev/null
+++ b/examples/with-composables/nuxt.config.ts
@@ -0,0 +1,4 @@
+import { defineNuxtConfig } from 'nuxt3'
+
+export default defineNuxtConfig({
+})
diff --git a/examples/with-composables/package.json b/examples/with-composables/package.json
new file mode 100644
index 0000000000..1fb77a9a04
--- /dev/null
+++ b/examples/with-composables/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "example-with-composables",
+ "private": true,
+ "devDependencies": {
+ "nuxt3": "latest"
+ },
+ "scripts": {
+ "dev": "nuxt dev",
+ "build": "nuxt build",
+ "start": "node .output/server/index.mjs"
+ }
+}
diff --git a/packages/kit/src/types/hooks.ts b/packages/kit/src/types/hooks.ts
index e27b71f537..5de25042ca 100644
--- a/packages/kit/src/types/hooks.ts
+++ b/packages/kit/src/types/hooks.ts
@@ -41,6 +41,7 @@ export interface NuxtHooks {
// Auto imports
'autoImports:sources': (autoImportSources: AutoImportSource[]) => HookResult
'autoImports:extend': (autoImports: AutoImport[]) => HookResult
+ 'autoImports:dirs': (dirs: string[]) => HookResult
// Components
'components:dirs': (dirs: ComponentsOptions['dirs']) => HookResult
diff --git a/packages/kit/src/types/imports.ts b/packages/kit/src/types/imports.ts
index c46655dff4..990645d0e7 100644
--- a/packages/kit/src/types/imports.ts
+++ b/packages/kit/src/types/imports.ts
@@ -46,4 +46,10 @@ export interface AutoImportsOptions {
* [experimental] Use globalThis injection instead of transform for development
*/
global?: boolean
+ /**
+ * Additional directories to scan composables from
+ *
+ * By default