Skip to content

build: Proposal to move from webpack to vite#19315

Open
capistrant wants to merge 7 commits into
apache:masterfrom
capistrant:web-console-build-speed
Open

build: Proposal to move from webpack to vite#19315
capistrant wants to merge 7 commits into
apache:masterfrom
capistrant:web-console-build-speed

Conversation

@capistrant

@capistrant capistrant commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Description

Draft code inspired by a question from @jtuglu1 #19312 (comment). I took it literally and used a claude session to plan and execute this proposed move to Vite. This was very much an exercise born out of curiosity so I am opening this for CI to run and will put in in Draft as I self review it and look for feedback regarding the webpack versus vite discussion. I did do basic testing locally where I had the vite dev server running locally and was making changes and seeing the millisecond response time from change to seeing it in my local. Even so, a larger discussion is warranted and there would likely be follow ups. The plan my session put in place marked multiple things as bridge solutions to minimize the changeset, but would require follow ups to fully leverage vite.

Release note

N/A


Key changed/added classes in this PR
  • vite.config.mts

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@Fly-Style

Copy link
Copy Markdown
Contributor

My 50 cents here: vite 8 uses rolldown, which reduces build time for tens of percent.

@jgoz jgoz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cloned locally and only saw one minor issue. It looks like my comments and the behavior around the Blueprint/Sass weirdness are preserved, so no concerns from me. Nice job!

Comment thread web-console/vite.config.mts Outdated
@capistrant capistrant marked this pull request as ready for review July 9, 2026 17:09

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Findings
P0 0
P1 1
P2 2
P3 0
Total 3
Severity Findings
P0 0
P1 1
P2 2
P3 0
Total 3

Reviewed 19 of 19 changed files.


This is an automated review by Codex GPT-5.6-Sol

Comment thread web-console/package.json
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.2.2"
"vite": "^8.1.4",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Align the declared Node engine with Vite 8

The locked Vite version requires Node ^20.19.0 || >=22.12.0, while the package still advertises >=20; Node 20.0-20.18 users therefore satisfy the project constraint but cannot reliably build or start the console.

Comment thread web-console/script/build
echo "Webpacking everything..."
NODE_ENV=production ./node_modules/.bin/webpack -c webpack.config.mjs --mode=production
echo "Building with Vite..."
NODE_ENV=production ./node_modules/.bin/vite build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Keep TypeScript errors fatal during builds

vite build transpiles without type-checking, unlike the removed ts-loader path. Maven CI runs test-ci without tsc --noEmit, allowing errors in untested source files to be packaged.

codeSplitting: false,
assetFileNames: (assetInfo) => {
if (/\.(woff2?|ttf|eot)$/.test(assetInfo.name || '')) {
return 'fonts/[name][extname]';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Generate font URLs under the served /public path

With Vite's default base, imported Fontsource CSS points to /fonts/..., while files are emitted under public/fonts and Jetty exposes only /public/*; production font requests will return 404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants