Skip to content

Monorepo usage - supporting of shared components #681

@ahudovich

Description

@ahudovich

Describe the bug

Trying to make it work in a monorepo powered by Turborepo without building the shared components. There is no much information on the topic.

In the app's vite config (/apps/test-app/vite.config.ts) I do this:

Components({
  dirs: ['src/components', '../../packages/shared/src/components']
})
  1. ../../packages/shared/src/components – this works only on project startup.
  2. When vite is running in dev mode, if you try to add a new component in the packages/shared/src/components, it won't be reflected in components.d.ts of the test-app.

I tried to add the shared components' path in server.fs.allow, but it doesn't work for me.

I attached a minimal reproduction for this issue.

Reproduction

https://github.com/andrei-hudovich/unplugin-vue-components-monorepo-issue

System Info

System:
    OS: macOS 13.4.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 506.21 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.volta/tools/image/node/18.17.1/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
  Browsers:
    Chrome: 116.0.5845.96

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions