mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2025-01-08 14:31:55 +00:00
96a6833dd3
In Vite 4, a simple regex was used to replace the variable, which would lead to undefined at runtime. That commit was a temporary fix until Vite 5 landed in stable, since supposedly it would improved upon this: https://vitejs.dev/guide/migration.html#rework-define-and-import-meta-env-replacement-strategy However, Vite's 5 behaviour it's still pure AST replacement (but consistent between dev and prod this time!) In order to avoid having the same constant repeated multiple times and increasing our bundle size, we are using the virtual modules to achieve the same behaviour. This way, we also have: * Proper TypeScript support * No need to configure the global in multiple places (like eslint config), * No need for an environment.d.ts file anymore. * The commit hash is a pure JavaScript const, we don't need to think about it differently and workaround the mismatches from Vite that lead us to refactor the commit hash stamping multiple times already. Signed-off-by: Fernando Fernández <ferferga@hotmail.com> |
||
---|---|---|
.. | ||
paths.ts | ||
virtual-modules.ts |