Bug/Documentation: How to share code between multiple vite.config.ts files #15005
Closed
1 of 4 tasks
Labels
documentation
Improvements or additions to documentation
Documentation is
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
The text was updated successfully, but these errors were encountered: