korge icon indicating copy to clipboard operation
korge copied to clipboard

Using Gradle task "jsBrowserDistribution"does not build correctly

Open Maddin-M opened this issue 2 years ago • 6 comments

How to reproduce:

  1. Checkout Korge Hello World
  2. Run ./gradlew jsBrowserDistribution
  3. Open build/distributions/index.html

Expected: image

Actual: image

It seems to me that the image resource isn't properly loaded in, as the animation still plays.

Maddin-M avatar Jul 28 '23 16:07 Maddin-M

Update: I have dockerized the app and needed to install audio and graphic libraries to compile and it does work. I believe something along this line might be the problem, as I also don't get audio. Btw, if you want I can create a PR for the Docker code and document it I'll be happy to do it.

Maddin-M avatar Jul 28 '23 18:07 Maddin-M

that'll be great if u have the time 🙂

Kietyo avatar Jul 29 '23 11:07 Kietyo

@Maddin-M You need and http server to run the distribution package, most of websites need this to run properly.

If you have python on a Linux/Mac you can run it like this :

cd ./build/distributions 
python -m http.server
Serving HTTP on :: port 8000 (http://[::]:8000/) ...

Then open http://localhost:8000/ with your browser.

If your goal is to test the application during development, run the gradle command : ./gradlew runJs

This will build the package and run it on a HTTP Server.

ygdrasil-io avatar Jul 31 '23 11:07 ygdrasil-io

@Maddin-M You need and http server to run the distribution package, most of websites need this to run properly.

If you have python on a Linux/Mac you can run it like this :

cd ./build/distributions 
python -m http.server
Serving HTTP on :: port 8000 (http://[::]:8000/) ...

Ok, I understand. I have one very small issue with the command still: When used on a multi-module project the output will not be in build/distributions but in build/dist/js/productionExecutable.

Maddin-M avatar Jul 31 '23 13:07 Maddin-M

that'll be great if u have the time 🙂

https://github.com/korlibs/korge-hello-world/pull/25 https://github.com/korlibs/korge/pull/1816

Maddin-M avatar Jul 31 '23 16:07 Maddin-M

TY

Kietyo avatar Aug 02 '23 07:08 Kietyo