Exporting as a Web Page

Disclaimer & limitations

The Kotlin Multiplatform Platform Stability page states that Kotlin/Wasm is in Alpha and Compose/Wasm is Experimental.

Also, in order to run Kotlin/Wasm in the browser, you need a browser that support both the Garbage collection and the Exception handling Wasm extension (see the WebAssembly browser feature report).

This means that, at least at the time of writing (22/04/2023):

  • Safari does not support Kotlin/Wasm (both Safari desktop & Safari mobile are out). This also excludes all iOS browsers (as browsers are required to use the safari engine under the hood).

  • CuP presentations exported as web pages may crash and/or bug, and therefore must not be used to present in front of an audience.

The possibility of exporting your presentation as a Web Page is a fun plus for CuP, and should not be relied upon.

Generating the web app

First, make sure you have configured the Web target (see the Quick start guide or the Creating a CuP application chapter).

To test the web application in your browser, execute the wasmJsBrowserRun Gradle task:

  • Linux / Mac

  • Windows

./gradlew wasmJsBrowserRun
gradlew.bat wasmJsBrowserRun

You can control the navigation with the same keys as with the desktop app.

To generate the web application, execute the wasmJsBrowserDistribution Gradle task:

  • Linux / Mac

  • Windows

./gradlew wasmJsBrowserDistribution
gradlew.bat wasmJsBrowserDistribution

All the web application files will be available in the build/dist/wasmJs/productionExecutable project directory.

Deploying to GitHub Pages