open-rmf / rmf-web

Apache License 2.0
87 stars 40 forks source link

dashboard: fix and improve build #986

Closed koonpeng closed 2 months ago

koonpeng commented 2 months ago

Some fixes and improvement to the build script.

  1. Fix deps not being built before the dashboard build.
  2. Uses a simple and a bit crude way to allow some variables to be configured after the bundle is built, inspired by import-meta-env. It uses the same method but a bit more crude and specialized, advantage is that we don't need node at runtime.
  3. Improvement on how we load some configs so that they can be analyzed and removed by terser (used by vite internally). Particularly keycloak/stub authenticator, all the admin and custom tabs components can be removed from the bundle if they are disabled.
  4. Fix some issues when building in humble.
koonpeng commented 2 months ago

New changes put all the build time config in buildConfig, fix some issues when building in humble and add a couple more build options.