I have a local repo(called repo-components) with some vue components and a package.json where I want to implement subpath exports, like so:
{
"name": "repo-components",
"version": "1.0.0",
"description": "Local repo",
"exports": {
"./components/": "./src/components/"
},
}
I want to then use that repo inside a Nuxt project(let's call it nuxt-project) as a dependency, and then use subpath exports like so inside nuxt-project:
import MyButton from 'repo-components/components/MyButton.vue'
However, when I try to do that import inside nuxt-project, it's not recognizing the subpath export I defined and simply tries to go directly to that path I defined(which doesn't exist). But if I try to do import MyButton from 'repo-components/src/components/MyButton.vue' then that works.
And if I try to use repo-components inside a simple node project and use require instead of import, then the exports field works perfectly, so clearly I'm missing some sort of configuration inside the Nuxt project.
Any help?