Skip to content

Commit

Permalink
chore(vue): Improve components and composables auto imports
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Dec 11, 2024
1 parent ddc4606 commit d966ae0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"import": "./dist/runtime/server/index.js"
},
"./components": {
"types": "./dist/runtime/components.d.ts",
"import": "./dist/runtime/components.js"
"types": "./dist/runtime/components/index.d.ts",
"import": "./dist/runtime/components/index.js"
},
"./composables": {
"types": "./dist/runtime/composables.d.ts",
"import": "./dist/runtime/composables.js"
"types": "./dist/runtime/composables/index.d.ts",
"import": "./dist/runtime/composables/index.js"
}
},
"main": "./dist/module.js",
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default defineNuxtModule<ModuleOptions>({
});
}

// Add auto-imports for Clerk components and composables
addImportsDir(resolver.resolve('./runtime/composables'));
void addComponentsDir({
path: resolver.resolve('./runtime/components'),
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion packages/nuxt/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { name, version } from './package.json';
export default defineConfig(() => {
return {
clean: true,
entry: ['./src/module.ts', './src/runtime/plugin.ts', './src/runtime/server/*.ts'],
entry: [
'./src/module.ts',
'./src/runtime/plugin.ts',
'./src/runtime/components/index.ts',
'./src/runtime/composables/index.ts',
'./src/runtime/server/*.ts',
],
format: ['esm'],
// Make sure to not bundle the imports
// or else the Nuxt module will not be able to resolve them
Expand Down

0 comments on commit d966ae0

Please sign in to comment.