Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export components from module #379

Open
YaredFall opened this issue Oct 3, 2024 · 1 comment
Open

Export components from module #379

YaredFall opened this issue Oct 3, 2024 · 1 comment

Comments

@YaredFall
Copy link

How can I export components from module?

For example, if I don't want to autoimport specific component or if consumer wants to import component explicitly.

I managed to find a way to export like this:

src/runtime/components/index.ts

export { default as Foo } from './foo.vue'

package.json

  ...
  "exports": {
    ...
    "./components": {
      "types": "./dist/runtime/components/index.d.ts",
      "import": "./dist/runtime/components/index.js"
    }
  },

But when I import Foo from my package, although its seems to work, the component has type any.

You can check details of my setup in this repo

@Jamie4224
Copy link

I have also had issues with this. I couldn't export any single functions / components without using the addImport / addComponent helpers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants