Skip to content

[CRAFTING] Use Vite to build widgets#2122

Open
samuelreichert wants to merge 19 commits intomainfrom
build/update-to-vite
Open

[CRAFTING] Use Vite to build widgets#2122
samuelreichert wants to merge 19 commits intomainfrom
build/update-to-vite

Conversation

@samuelreichert
Copy link
Contributor

@samuelreichert samuelreichert commented Mar 3, 2026

Pull request type

Dependency changes (any modification to dependencies in package.json)
Refactoring (e.g. file rename, variable rename, etc.)


Description

Adding vite and scripts on all widgets for building with vite, and generating the MPK using vite.
Also adding a benchmark script to compare current build and vite build (Vite + Rollup)

@samuelreichert samuelreichert marked this pull request as ready for review March 4, 2026 16:53
@samuelreichert samuelreichert requested a review from a team as a code owner March 4, 2026 16:53
- Created Vite configuration files for the following widgets
- Events, Fieldset, Gallery, Google Tag, HTML Element, Image, Language Selector, Maps
- Markdown, Popup Menu, Progress Bar, Progress Circle, Range Slider, Rating
- Selection Helper, Skip Link, Slider, Switch, Timeline, Tooltip, Tree Node, and Video Player
- Updated package.json files to include new build scripts for Vite and benchmark scripts
- Added Vite as a dependency in the package.json files of the affected widgets.
- Adjusted SCSS imports in Range Slider to use relative paths.
- Update build scripts in pluggable widgets to remove unnecessary
- rollup and rolldown configurations, standardizing to a single command
- Removed redundant vite from package.json files across widgets
- Ensured consistency in the use of cross-env in build scripts
@iobuhov
Copy link
Collaborator

iobuhov commented Mar 5, 2026

Did you tried to rune dev? I'm curious as it should work, but I'm not sure how good. We might need spend some time on merging this code into widget tools + we need time to build "runtime" code to mock PW API. This way we have "sandbox" where widget can be fully rendered and tested.

@iobuhov
Copy link
Collaborator

iobuhov commented Mar 6, 2026

Let's try to make vite devcommand work. Also, let's switch repo for this PR. We need merge it to widget-tools repo.

…ared vite config

- Removed individual vite.config.js files from multiple pluggable widgets
- Updated package.json scripts to use the shared vite.config.ts for both dev and prod builds
- Ensured consistency across all pluggable widgets by standardizing the build process
extract config creation/resolution into config/*
extract mpk/editor build steps into build/*
extract package/json helpers into helpers/*
centralize shared types in types.ts
keep both direct CLI and programmatic createWidgetViteConfig compatibility
update README to document module layout and usage modes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment