This is a Kotlin Multiplatform project targeting Web.
- /shared is for code that will be shared across your Compose Multiplatform applications.
It contains several subfolders:
- commonMain is for code that’s common for all targets.
- wasmJsMain is for Kotlin/Wasm-specific code.
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, the iosMain folder would be the right place for such calls. Similarly, if you want to edit the Desktop (JVM) specific part, the jvmMain folder is the appropriate location.
Use the run configurations provided by the run widget in your IDE's toolbar. You can also use these commands and options:
- Web app:
./gradlew :webApp:wasmJsBrowserDevelopmentRun
Use the run button in your IDE's editor gutter, or run tests using Gradle tasks:
- Web tests:
./gradlew :shared:wasmJsTest
This repository uses GitHub Actions to build and deploy the Web app to GitHub Pages on every push to master.
- On GitHub, open Settings > Pages.
- Under Build and deployment, set Source to GitHub Actions.
- Push to
master, or run the Deploy GitHub Pages workflow manually from the Actions tab.
The workflow builds the production Web distribution with:
./gradlew :webApp:wasmJsBrowserDistributionand deploys:
webApp/build/dist/wasmJs/productionExecutable
Learn more about Kotlin Multiplatform, Compose Multiplatform, Kotlin/Wasm…
We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel #compose-web. If you face any issues, please report them on YouTrack.