Skip to content
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

Fix Tauri Build #3

Open
kristianbinau opened this issue Sep 7, 2023 · 2 comments
Open

Fix Tauri Build #3

kristianbinau opened this issue Sep 7, 2023 · 2 comments

Comments

@kristianbinau
Copy link
Contributor

Currently Tauri works, but only if we use tauri dev, this just opens our localhost:4321. But when we build we have to bundle all the necessary code and dependencies we need to run our project. When we build almost everything gets bundled except Node.

Accepttest:

  • Add Node as a Sidecar (example)
  • Fix other things we might be needing.
@kristianbinau kristianbinau self-assigned this Sep 9, 2023
kristianbinau added a commit that referenced this issue Sep 9, 2023
kristianbinau added a commit that referenced this issue Sep 9, 2023
@kristianbinau
Copy link
Contributor Author

See @feat-packaged-node-tauri, this is a WIP.

Brain dump:

  • Tried pkg, seems to work a little maybe, threw a bunch of warnings at build, but failed to start after build.
  • Tried caxa, seems to be the easier choice, but at first try it didn't really work.
  • Currently we build Astro to be run as a node server, this produces a /dist that seems like it only depends on /node_modules and itself (/dist).
    • This build can be run with node dist/server/entry.mjs, this will start a node server.
    • So the only task is to find a way of bundling node, /node_modules, /dist
    • A problem with this solution would also be that we start a node server on the users PC, this seems pretty stupid.
  • It could maybe make sense to investigate building as a Deno server or something else.
  • It could also make sense to investigate if we can build as static files instead, so we don't start a server on the users PC's
    • Only problems is that the Auth and fetching we currently do seemingly doesn't work when building as static.
  • Important takeaway: Tauri as it is installed in the project currently works as a prof of concept, it 100% works when building with tauri dev as this just uses the server that Astro starts.

@kristianbinau
Copy link
Contributor Author

Maybe bun own compiler could work: https://bun.sh/docs/bundler/executables on first try this seems to work, but it can't find "node:fs"

@kristianbinau kristianbinau removed their assignment Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant