Hello,
The separation sounds better that way but I'm still not comfortable calling this degraded mode "advancedMode" because it sounds like it is a mode for people having a deep understanding of Vite and wanting more control when it is realy a degraded mode not following the documentation and potentially corrupting the dev server run, creating unexpected problems.
I see this mode more like a degraded mode to make impossible out of box interoperabilities possible in a simple way but not the better way.
I'm curious about which https://www.drupal.org/project/advagg → you are using and if some Vite or Rollup plugin already do it ??
Hello,
@Hugo'C
If you use this module in a standard way you should not have a nodeJS server runing in production. You should have a manifest.json pointing on already built assets.
The nodeJS server only run in dev mode or during build time.
Vite is not serving assets in production mode, it is your Drupal via the theme libraries. But it is indeed this module who alter the library to serve the right assets based on the manifest.json content.
If you want to alter the way this module is altering assets to meet your need I suggested you use https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21....
If you do not want to serve the library in production, you can do a condition on the environnement and unset the vite library you used in dev mode.
Hello,
I'm working in a docker environment with multiple projects runing at the same time, with multiple Vite server runing at the same time.
I think it is not a Drupal module problematic, you need a reverse proxy that will do routing with port binding correctly depending on network rules.
I implemented https://traefik.io/ in order to expose vite server and port through custom domain names. I do not have the need to bind port on my computer directly anymore, that solves the problem.
Hello,
If we follow the Vite Backend integration documentation : https://vitejs.dev/guide/backend-integration.html, it is needed to read the "manifest.json" file in production in order to locate assets in the build folder.
It is not recommended to disable the file hash system because it limits the use of multiple entry files. It is not a way of doing that is tested and documented by the community.
I'm obligated to side with @wotnak on the fact that it is not the rigth approach to disable the vite module in production.
If you are afraid that dev configuration is interfering in production, and have question about security, maybe we can help you understand how to secure things ?