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

Unbuild Stub breaks in Vue Vite application #1

Closed
varugasu opened this issue Sep 5, 2023 · 3 comments · Fixed by #2
Closed

Unbuild Stub breaks in Vue Vite application #1

varugasu opened this issue Sep 5, 2023 · 3 comments · Fixed by #2

Comments

@varugasu
Copy link
Owner

varugasu commented Sep 5, 2023

Relates to unjs/unbuild#300

When running unbuild --stub in the vue-shining-text package, the Vue Playground breaks by raising:

[vite] Internal server error: Failed to resolve entry for package "vue-shining-text". The package may have incorrect main/module/exports specified in its package.json.
@varugasu varugasu changed the title Unbuild Stub in Vue Vite application Unbuild Stub breaks in Vue Vite application Sep 5, 2023
@varugasu
Copy link
Owner Author

varugasu commented Sep 5, 2023

That worked, @pi0 ! Thank you!! You said:

By creating a top level .mjs entry, we can trick vite into resolving .ts (stubbed) files and also have a valid production package.

Why a valid production package must have an index.mjs outside of src?

@pi0
Copy link
Contributor

pi0 commented Sep 5, 2023

It is because is shared between stub mode and production. Otherwise you could directly point to dist/index.mjs

@varugasu
Copy link
Owner Author

varugasu commented Sep 5, 2023

@pi0 thank you for the help! Learned a lot

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

Successfully merging a pull request may close this issue.

2 participants