Frontend: Migrate from Webpack to Vite
As a frontend developer, I want the production build migrated from webpack to Vite, so that the build and test toolchains converge on one bundler and ESM-only dependency majors stop blocking upgrades.
The production bundle was built with webpack (frontend/webpack.config.js, via make build-js), while the Vitest unit and component tests already ran on Vite. Moving the build to Vite leaves one toolchain to maintain. It also removes webpack 5's hard failure on ESM-only packages that import Node built-ins, such as vue3-gettext 4.x.
This migration is done together with the Vuetify 4 upgrade in #5849, so that the upgrade can be developed and tested with Vite. The build switch landed first, with Vuetify unchanged, so that any difference can be attributed to the build alone. Users should notice no change beyond possibly faster loading.
The Vite build, its plugins, and the Go server's asset manifest contract are documented in frontend/README.md under "Production Build".
Acceptance Criteria
- MUST build the web app, sharing, and splash entry points with Vite in all editions (
plus,pro,portal), producing theassets/static/build/assets.jsonmanifest the server expects. - MUST keep the Progressive Web App working, including the generated service worker and the precompressed
.gz/.zstassets. - MUST keep working when static assets are served from a CDN or when PhotoPrism runs under a base path.
- MUST support the browsers that our frontend dependencies can actually run on, and apply that range consistently to the build target and the browser check.
- MUST NOT make the web interface slower or heavier to load than the current webpack build.
- MUST remove webpack and its loaders and plugins from
frontend/package.json, withmake auditclean andfrontend/NOTICEregenerated viamake notice. - MUST pass
make test-js,make lint-js, and the acceptance tests. - SHOULD confirm that
vue3-gettext4.x builds without a workaround.
Source: photoprism/photoprism