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

Bug/Documentation: How to share code between multiple vite.config.ts files #15005

Closed
1 of 4 tasks
philly-vanilly opened this issue Nov 16, 2023 · 2 comments
Closed
1 of 4 tasks
Labels
documentation Improvements or additions to documentation

Comments

@philly-vanilly
Copy link

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

I have problems with vite.config.ts importing from a typescript file in another local (monorepo-lib, also typescript) package. It tells me that I cannot use "import outside a module" or "unknown token export".

What have I tried so far? When I change the lib in package.json to "type": "module" it complains that I try to use an ESM module and I don't want to make my whole main app a module and just turning vite.config.ts to .mts does not work.

I am using target and module esnext in my lib and in my app. I also have compotite: true with a reference-path from app's to lib's tsconfig.

Please tell me (and update the docs) how to share code between multiple vite.config.ts files. I have 6 different apps running in module federation and want to share some local setup constants and functions. If it is not possible please add at least a warning in the docs or something.

Thank you, I appreciate your work!

Your Suggestion for Changes

Reproduction

No response

Steps to reproduce

No response

@philly-vanilly philly-vanilly added the documentation Improvements or additions to documentation label Nov 16, 2023
@NozomuIkuta
Copy link
Contributor

Would you provide a reproduction or repository, so that someone including me could understand your situation in more detail and could help?

@bluwy
Copy link
Member

bluwy commented Dec 22, 2023

I think this is a duplicate of #5370. The linked issue provides some workarounds.

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants