You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For reference, please see this repo. In the repo, I have a sample library that I'm building with vite. When it gets built, it includes 3 JS files:
classes.js
index.js
injectionKeys.js
The respective type files are also included, but they're not important. When I build this on Windows 10 using npm 8.15.0 and node 16.17.0, I get a strange result. In index.js on line 2, where it's supposed to import injectionKeys.js, it actually just adds the code const AppConfigKey = Symbol("AppConfig");. This is obviously problematic because the symbols are not unique if I'm then importing injectionKeys.js outside of the lib. When I build this on Ubuntu, I do not get this issue.
Furthermore, if I build this with rollup (with what I believe is almost the same configuration) using npm run build:rollup, I don't get this issue on Windows.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
For reference, please see this repo. In the repo, I have a sample library that I'm building with vite. When it gets built, it includes 3 JS files:
The respective type files are also included, but they're not important. When I build this on Windows 10 using npm 8.15.0 and node 16.17.0, I get a strange result. In
index.js
on line 2, where it's supposed to importinjectionKeys.js
, it actually just adds the codeconst AppConfigKey = Symbol("AppConfig");
. This is obviously problematic because the symbols are not unique if I'm then importinginjectionKeys.js
outside of the lib. When I build this on Ubuntu, I do not get this issue.Furthermore, if I build this with rollup (with what I believe is almost the same configuration) using
npm run build:rollup
, I don't get this issue on Windows.Do note that I'm using [email protected] because of the known issue with lib builds in v3.
Reproduction
https://github.com/incutonez/windows-linux-vite
System Info
Used Package Manager
npm
Logs
index.js built with vite on Win10
index.js built with rollup on Win10
Validations
The text was updated successfully, but these errors were encountered: