-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build performance with vite #6732
Comments
I made the second approach work using the following nginx config snippet, which certainly can be optimized:
|
I managed to simplify the setup a lot:
This way even HRM updates via websockets work, so no page reloads needed anymore. So far I tested it with Text in viewer and Collectives. If we find a way to make the reverse proxy configuration in nginx switchable that could be a good way forward in my eyes. |
I wonder if something like this could work: https://stackoverflow.com/a/64060513
So if vite is not running fall back to the default nextcloud server. |
I can imagine we just mount a user editable config file to the container so people could add the config for their apps more easily. Don't think there is a nice way to auto configure that as we'll always need the manual port to app path mapping. |
Fixes: #6732 Signed-off-by: Jonas <[email protected]>
I found a way to do the redirects in vite and opened a PR that adds support for
|
The PR is #6765 |
Fixes: #6732 Signed-off-by: Jonas <[email protected]>
Fixes: #6732 Signed-off-by: Jonas <[email protected]>
I suggest we use a non-standart port and add it to the vite config. Then we can hardcode the same port in nextcloud-docker-dev. I suggest 7347 😉 |
Fixes: #6732 Signed-off-by: Jonas <[email protected]>
Fixes: #6732 Signed-off-by: Jonas <[email protected]>
Describe the bug
Since the migration to vite, building the javascript assets takes much longer. This is particularly annoying during development, when using
npm run dev
ornpm run watch
.This is mostly due to our dependencies mermaid and highlight.js being really heavy and being rebuilt each time by vite.
Some ideas we had so far:
Build mermaid and highlight.js separately
vite.config.ts
mark these modules as external viabuild.rollupOptions.external
.Problem: Building with
vite
clears the target directory upfront. So we cannot build assets into the same target directory using two separatevite
processes.Use
vite serve
to provide the javascriptvite serve
is really fast.NODE_ENV=development npm exec vite -- --mode development serve --host
in Text starts the vite webserver that provides content on port 5173/apps/text/js/*
to the vite webserver. Onnginx
fromnextcloud-docker-dev
this can be done the following way:Problem: I didn't manage to make vite provide all required files yet.
@juliusknorr @max-nextcloud feel free to adjust and add other ideas.
The text was updated successfully, but these errors were encountered: