allow the JS compiler to reference the JS library source so that maven based JS compilation can work & use the new kotlin.browser API
This commit is contained in:
@@ -31,6 +31,9 @@
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<configuration>
|
||||
<jsLibrarySourceDir>${kotlin-js-lib-srcdir}</jsLibrarySourceDir>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>js</id>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h1>Kotlin Sample</h1>
|
||||
|
||||
<div id="foo">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="target/js/kotlin-lib.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="target/js/browser-example.js">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,6 @@ import kotlin.browser.document
|
||||
fun myApp() {
|
||||
val element = document.getElementById("foo")
|
||||
if (element != null) {
|
||||
element.appendChild(document.createTextNode("Some Dynamically Created Contenet!!!"))
|
||||
element.appendChild(document.createTextNode("Some Dynamically Created Content!!!"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user