Open misakamayako opened 1 week ago
It's expected for the define replacement to handle inside node_modules
, you can add things like process.env.LIB_VALUE: ".."
that will be replaced in the library, depending if you need to.
For this specific case, you're using Vite 4 which had a much looser replacement handling that can caused issues like this. It should be fixed in Vite 5 now, which worked for me when I upgrade it in the repro.
Describe the bug
As stated in the title, in this example, the define section replaces the
version
field exported by the vue package with the data I defined, causing a critical error.Reproduction
https://stackblitz.com/edit/vitejs-vite-jiy9qb?file=main.js
Steps to reproduce
just run
npm build
System Info
Used Package Manager
npm
Logs
Validations