Closed softdevca closed 11 months ago
Ah, I must upgrade the instructions even more :P
Try running ./release.sh
, this will build the frontend, put the dist/index.html
in the right place, and then run nativeImage.
Is there a way to modify the build process so the step isn't necessary instead? The only thing better than documentation is not needing documentation. :)
I haven't run release.sh
yet but I suspect something is amiss with this
line:
mv ./cli-frotnend/dist ./cli/src/main/resources/dist
On Wed, 16 Jun 2021 at 15:04, Kit Langton @.***> wrote:
Ah, I must upgrade the instructions even more :P Try running ./release.sh, this will put the dist/index.html in the right place.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kitlangton/zio-app/issues/18#issuecomment-862759813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR5U7SBLHXLFB7RQBLSWTLTTENVTANCNFSM46Z5H3ZA .
😆 Yeah. frotnend
... doh.
I'm not sure. I'd have to see if I can make an sbt
command that will basically do what that script does. Good idea though.
I encountered the same issue as OP, but looking at release.sh
I see several issues that may need to be addressed:
frotnend
as mentioned aboveyarn install
from cli-frontend
(or ensure that it has been run)mv ./cli-frontend/dist ./cli/src/main/resources/dist
fails as the dir does not exist:
cli-frontend/vite.config.js
this line: outDir: '../cli/src/main/resources/dist',
should take care of that already.open .
is a macOS commandI did get the zio-app dev
to run after taking care of this.
I'm not sure. I'd have to see if I can make an
sbt
command that will basically do what that script does. Good idea though.
We could perhaps make use of sbt's support for external processes to run the yarn exec -- vite build
, and
tar -czf zio-app.gz zio-app
echo $(shasum -a 256 zio-app.gz)
Using the nativeImageOutput
configuration should help us get rid of
cd cli/target/native-image
mv zio-app-cli zio-app
altogether.
And wrap it all up into a custom sbt task.
Thanks for exploring this @mtjon! I'll look into wrapping this into an sbt task :)
zio-app dev
starts but when the link is opened an exception results becausedist/index.html
is not on the classpath.zio-app
is built from the latest source as of 2021-06-16.