nuxt / components

Scan and auto import components for Nuxt.js 2.13+
MIT License
887 stars 48 forks source link

Can a library module still import components manually? #238

Closed existe-deja closed 2 years ago

existe-deja commented 3 years ago

Describe the bug I'm creating a vuejs UI library and I still manually importing my components because it's simplier for testing, storybook, and non Nuxt project. If I follow the doc and I merge my components directory through components:dir hook then I have a resolution error and my component is not found.

To Reproduce Use a valid import inside your library. See https://codesandbox.io/s/practical-feynman-30sgz?file=/modules/mylib/src/components/HelloRich.vue And remove comments

Expected behavior I should be able to manually import my components inside my external library

existe-deja commented 2 years ago

I found a workaround. In my library I import components with a relative path. Then the nuxt auto import can resolve everything.