delucis / astro-auto-import

Auto-import components in Astro projects
84 stars 2 forks source link

Import entire directory as namespace #44

Closed fitzage closed 3 months ago

fitzage commented 3 months ago

I’d love to be able to point this at an entire directory or subdirectory and have all the components in that directory be namespaced, so something like this:

imports: [
  {
    './src/components/atoms/*': ‘Atoms',
  },
];

and then use them like <Atoms.MyAtom />

Basically an expansion of the current Namespace Import to support a directory of components instead of a single file with multiple modules.

delucis commented 3 months ago

Thanks for the feature request @fitzage! I think this is a duplicate of #20, so will close it to redirect discussion there.