Skip to content

Add Vite for javascript assets

Stanislav Lashmanov requested to merge slashmanov/vite-js-dev-2 into master

What does this MR do and why?

RFC

This MR adds vite as a frontend runner for javascript assets instead of webpack in development mode.

This is intended only for developer experience evaluation purposes. That's why it's behind a feature flag.

This MR fixes the issue with the CNG deployments from Add Vite for javascript assets in development mode (!115469 - merged).

How to test locally

  1. Run echo "Feature.enable(:vite)" | gdk rails c
  2. Launch bundle exec vite dev
  3. Restart GDK

Issues with local vite server

Current configuration assumes you've set up gdk.test domain on a specific IP address. In case you're running it on localhost please change config/vite.json development host to localhost.

How to build

Make sure you have 10GB of RAM free. 😄

  1. Run NODE_OPTIONS="--max_old_space_size=10240" bundle exec vite build
Edited by Stanislav Lashmanov

Merge request reports