Skip to content

NXT-573: Added Vite bundler#393

Open
daniel-stoian-lgp wants to merge 20 commits into
developfrom
feature/NXT-573
Open

NXT-573: Added Vite bundler#393
daniel-stoian-lgp wants to merge 20 commits into
developfrom
feature/NXT-573

Conversation

@daniel-stoian-lgp

@daniel-stoian-lgp daniel-stoian-lgp commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • I have run automated testing and it is passed
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

Added a complete, opt-in Vite bundler path to @enact/cli, alongside webpack.

The Vite path is only reachable via --vite or ENACT_BUNDLER=vite; both bundlers coexist for the duration of the migration.

Depends on the companion @enact/dev-utils PR (NXT-573). config/vite.config.js consumes ViteHtmlPlugin / ViteILibPlugin / ViteWebOSMetaPlugin from it.

Every pack/serve feature is covered:

Files:

  • New: config/vite.config.js (the port of webpack.config.js, same factory signature), commands/vite-utils.js, four docs.
  • Changed (Vite branch added, webpack untouched): commands/pack.js, commands/serve.js, commands/eject.js.
  • Refactor touching webpack: the PostCSS chain moved out of config/webpack.config.js into config/postcss-plugins.js (getPostCssPlugins) so both configs share one copy — same plugin array, same order, no behavior change. This is the only webpack-facing change and the main thing to review.
  • Dependencies added: vite, @vitejs/plugin-react, terser, vite-plugin-node-polyfills.

Resolution

Validated end-to-end on real apps: Sandstone (React 18, pre-compiled deps) and Limestone (React 19, ships raw @enact source with JSX-in-.js and ~ npm imports), plus qa-dropdown, the redux sample, and the aggregate all-samples.

Validation was done in a real browser, Eight config issues and eight runtime issues were found and fixed; all are documented with root causes in docs/vite-migration.md.

Additional Considerations

How to test:

cd cli && npm install                 # pulls vite + @vitejs/plugin-react + terser
# from an Enact app dir:
enact serve --vite                    # or ENACT_BUNDLER=vite enact serve
enact pack -p --vite                  # production build
enact pack -p --vite -l en-US,ko-KR   # locale-filtered
enact pack -p -i --vite               # isomorphic

Links

NXT-573

Comments

Enact-DCO-1.0-Signed-off-by: Daniel Stoian (daniel.stoian@lgepartner.com)

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