jellyfin-vue/frontend/scripts
Fernando Fernández 96a6833dd3
revert: f68f807
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>
2023-12-05 18:36:17 +01:00
..
paths.ts refactor-feat(localization): logic, use vuetify locales 2023-08-10 11:32:59 +02:00
virtual-modules.ts revert: f68f807 2023-12-05 18:36:17 +01:00