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

Unable to use in a monorepo (yarn workspaces) #14

Closed
spaceemotion opened this issue Jun 29, 2021 · 1 comment
Closed

Unable to use in a monorepo (yarn workspaces) #14

spaceemotion opened this issue Jun 29, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@spaceemotion
Copy link

The following line breaks the package in a monorepo setup:

https://github.com/qmhc/vite-plugin-dts/blob/main/src/index.ts#L162

Yarn (workspaces) puts the dependencies at the project root, and not besides each package (to reduce duplications).

I was able to "fix" this for our setup via the nohoist option in yarn.

Is there a reason for using resolve and not just a plain require('@vue/compiler-sfc)?

Cheers!

@qmhc qmhc added the bug Something isn't working label Jun 30, 2021
@qmhc
Copy link
Owner

qmhc commented Jun 30, 2021

In my case, I set root option to the monorepo root dir, because this can generate full declarations when a package references other packages. Combining with bundle declarations tools like @microsoft/api-extractor, can finally generate a single declaration file.

Monorepo has a lot of variables that may need to be manually config to some extent.

Hope my practice can provide some help for you.

For single bundling each package, this issue is a problem, I will fix it later.

@qmhc qmhc closed this as completed in fd9b5c1 Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants