Skip to content

Draft: Add Vite for development mode

Stanislav Lashmanov requested to merge slashmanov/vite into master

This is outdated. Visit Add Vite for javascript assets in development mode (!115469 - merged)

What does this MR do and why?

RFC

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

How to test locally

  1. Run echo "Feature.enable(:vite)" | gdk rails c
  2. (optionally) Run echo "Feature.enable(:vite_stylesheets)" | gdk rails c, this will enable Vite for styles
  3. Launch bundle exec vite dev
  4. 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

TODO

  1. Merge Change url variable syntax to a valid one (gitlab-ui!2965 - merged)
  2. Fix EE and JH styles
  3. Put everything under a feature flag
  4. Make it work for production build and other envs
  5. Test, test, test
  6. Replace remaining webpack-related stuff with vite counterparts

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stanislav Lashmanov

Merge request reports