File tree Expand file tree Collapse file tree 8 files changed +1051
-22
lines changed
compose-multiplatform-material
commonMain/kotlin/com/huanshankeji/compose/material/demo
kotlin/com/huanshankeji/compose/material/demo
jvmMain/kotlin/com/huanshankeji/compose/material/demo Expand file tree Collapse file tree 8 files changed +1051
-22
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,18 @@ kotlin {
2323 }
2424 named(" jsMain" ) {
2525 dependencies {
26+ // copied from https://github.com/mpetuska/kmdc
27+
2628 // Be lazy and use the shortcut
2729 implementation(" dev.petuska:kmdc:0.0.5" )
2830 implementation(" dev.petuska:kmdcx:0.0.5" )
2931 // TODO: pick and choose exact components to reduce bundle size
32+
33+ // SCSS dependencies
34+ implementation(devNpm(" style-loader" , " ^3.3.1" ))
35+ implementation(devNpm(" css-loader" , " ^6.7.1" ))
36+ implementation(devNpm(" sass-loader" , " ^13.0.0" ))
37+ implementation(devNpm(" sass" , " ^1.52.1" ))
3038 }
3139 }
3240 }
Original file line number Diff line number Diff line change @@ -3,7 +3,14 @@ plugins {
33}
44
55kotlin {
6- js(IR ) { browser() }
6+ js(IR ) {
7+ browser {
8+ commonWebpackConfig {
9+ outputFileName = " app.js"
10+ }
11+ }
12+ binaries.executable()
13+ }
714
815 sourceSets {
916 named(" commonMain" ) {
@@ -17,5 +24,24 @@ kotlin {
1724 implementation(compose.desktop.currentOs)
1825 }
1926 }
27+ /* TODO: uncomment or remove
28+ named("jsMain") {
29+ dependencies {
30+ // copied from https://github.com/mpetuska/kmdc
31+
32+ // SCSS dependencies
33+ implementation(devNpm("style-loader", "^3.3.1"))
34+ implementation(devNpm("css-loader", "^6.7.1"))
35+ implementation(devNpm("sass-loader", "^13.0.0"))
36+ implementation(devNpm("sass", "^1.52.1"))
37+ }
38+ }
39+ */
40+ }
41+ }
42+
43+ compose.desktop {
44+ application {
45+ mainClass = " com.huanshankeji.compose.material.demo.MainKt"
2046 }
2147}
Original file line number Diff line number Diff line change 11package com.huanshankeji.compose.material.demo
22
3- fun main () {
4- // TODO
5- }
3+ expect fun main ()
Original file line number Diff line number Diff line change 1+ package com.huanshankeji.compose.material.demo
2+
3+ import org.jetbrains.compose.web.renderComposableInBody
4+
5+ actual fun main () {
6+ renderComposableInBody { App () }
7+ }
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+
4+ < head >
5+ < meta http-equiv ="Content-Type " content ="text/html; charset=UTF-8 ">
6+ < meta charset ="UTF-8 ">
7+ < title > Compose Multiplatform Material demo</ title >
8+ </ head >
9+
10+ < body >
11+ < script src ="app.js "> </ script >
12+ </ body >
13+
14+ </ html >
Original file line number Diff line number Diff line change 1+ package com.huanshankeji.compose.material.demo
2+
3+ import androidx.compose.ui.window.Window
4+ import androidx.compose.ui.window.application
5+
6+ actual fun main () = application {
7+ Window (::exitApplication) {
8+ App ()
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ // copied from https://github.com/mpetuska/kmdc/blob/master/gradle/webpack.config.d/scss.js
2+
3+ config . module . rules . push ( {
4+ test : / \. ( s c s s | s a s s ) $ / ,
5+ use : [
6+ /**
7+ * fallback to style-loader in development
8+ * "style-loader" creates style nodes from JS strings
9+ */
10+ "style-loader" , // translates CSS into CommonJS
11+ "css-loader" , // translates CSS into CommonJS
12+ "sass-loader" // compiles Sass to CSS, using Node Sass by default
13+ ]
14+ } ) ;
15+ config . module . rules . push ( {
16+ test : / \. c s s $ / ,
17+ use : [
18+ /**
19+ * fallback to style-loader in development
20+ * "style-loader" creates style nodes from JS strings
21+ */
22+ "style-loader" , // translates CSS into CommonJS
23+ "css-loader" , // translates CSS into CommonJS
24+ ]
25+ } ) ;
You can’t perform that action at this time.
0 commit comments