Skip to content

Migrate JS build tooling to Vite+ - #502

Open
simon04 wants to merge 8 commits into
hound-search:mainfrom
simon04:vite-plus
Open

Migrate JS build tooling to Vite+#502
simon04 wants to merge 8 commits into
hound-search:mainfrom
simon04:vite-plus

Conversation

@simon04

@simon04 simon04 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Migrates the UI build and test tooling from webpack/Babel/Jest to Vite+ (Rolldown, Vitest, Oxc, Oxfmt), building both self-contained IIFE bundles in a single vp build via per-entry build environments. Also drops Babel/pretty-quick and wires the new build/test scripts into the Makefile.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

The PR fulfills these requirements:

  • All tests are passing?
  • New/updated tests are included?
  • If any static assets have been updated, has ui/bindata.go been regenerated?
  • Are there doc blocks for functions that I updated/created?

Other information:

https://viteplus.dev/guide/

simon04 added 8 commits June 28, 2026 11:00
Replace Jest with `vp test` (Vitest) and pretty-quick/Prettier with
`vp fmt` (Oxfmt). Test and format config moves into vite.config.ts,
so jest.config.js, .prettierrc and .prettierignore are removed.
Apply Oxfmt formatting across the repo now that Prettier is replaced by
`vp fmt`. Also update the README testing docs to reference Vitest.
Introduce a `build` npm script (`webpack --mode production`) and call it
from the Makefile instead of invoking webpack directly.
Add a `build:dev` script (`webpack --mode development`) and have the
Makefile use it when DEBUG is set, restoring the development-mode build
dropped when webpack invocation moved into the build script.
Replace the webpack/babel-loader build with `vp build` (Vite/Rolldown).
Each UI page still ships a self-contained classic script, so the two
entries are built as separate IIFE bundles (one `vp build` per entry,
selected via --mode) into ui/.build/ui/js, matching the previous output
that ui/ui.go inlines into a <script> tag.

JSX is handled by esbuild's classic runtime targeting the global `React`
(loaded via react-*.min.js), so no `react` import is injected and Babel
is no longer needed. The two JSX entries are renamed to .jsx; build/test/
format config lives in vite.config.ts. Removes @babel/*, babel-loader,
webpack, webpack-cli and webpack-dev-server.
Replace the per-entry --mode invocations with Vite's Environment API: each
entry is its own IIFE build environment and builder.buildApp builds them in
a single `vp build`. JSX config moves to the oxc.jsx block (Vite 8 uses the
Oxc transformer), and build:dev switches to --mode development for the
unminified build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant