Skip to content

Commit b279010

Browse files
committed
DCE in 1.3.60
1 parent 9ac2702 commit b279010

File tree

5 files changed

+35
-14
lines changed

5 files changed

+35
-14
lines changed

app/build.gradle.kts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
plugins {
22
kotlin("js")
3+
id("kotlin-dce-js")
34
}
45

56
group = "com.ilgonmic"
67
version = "1.0-SNAPSHOT"
78

89
repositories {
9-
mavenLocal()
1010
mavenCentral()
1111
}
1212

@@ -17,18 +17,19 @@ dependencies {
1717

1818
kotlin {
1919
target {
20-
browser {
20+
browser {}
21+
}
22+
}
2123

22-
// This strange case only for test :)
23-
dceKeep.add("kotlinjs-multi-module-app.notDelete")
24+
tasks {
25+
runDceKotlin {
26+
dceOptions {
27+
outputDirectory = "${rootProject.buildDir}/js/packages/${rootProject.name}-${project.name}/kotlin-dce"
28+
}
2429

25-
webpackTask {
26-
dceEnabled = false
27-
}
30+
getByName("browserWebpack").dependsOn(this)
2831

29-
runTask {
30-
dceEnabled = true
31-
}
32-
}
32+
// It should be improved, DCE and optimize.js is not necessary to use with run task
33+
getByName("browserRun").dependsOn(this)
3334
}
3435
}

app/webpack.config.d/optimize.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function () {
2+
var path = require('path');
3+
4+
config.entry = [path.resolve(__dirname, "kotlin-dce/kotlinjs-multi-module-app.js")];
5+
6+
config.resolve.modules.unshift(path.resolve(__dirname, "kotlin-dce"));
7+
8+
config.mode = "production";
9+
10+
config.devtool = "source-map"
11+
})();

app/webpack.config.d/output.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
plugins {
2-
kotlin("js") version "1.3-SNAPSHOT" apply false
2+
kotlin("js") version "1.3.60-eap-23" apply false
33
}
44

55
group = "com.ilgonmic"
66
version = "1.0-SNAPSHOT"
77

8+
allprojects {
9+
repositories {
10+
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
11+
mavenCentral()
12+
}
13+
}
14+
815
tasks {
916
wrapper {
1017
distributionType = Wrapper.DistributionType.ALL

lib/src/main/kotlin/Lib.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ fun answer(): Int {
44

55
fun sheldon(): Int {
66
return 73
7+
}
8+
9+
fun sheldon2(): Int {
10+
return 37
711
}

0 commit comments

Comments
 (0)