You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[//]: #(title: Development server and continuous compilation)
2
2
3
-
Instead of manually compiling and executing a Kotlin/JS project every time you want to see the changes you made,
4
-
you can use the _continuous compilation_ mode. Instead of using the regular `run` command, invoke the Gradle wrapper
5
-
in _continuous_ mode:
3
+
Instead of manually compiling and running your Kotlin/JS project each time you want to see the changes you made,
4
+
you can use the _continuous compilation_ mode. Rather than using the regular `jsBrowserDevelopmentRun` (for `browser`) and `jsNodeDevelopmentRun` (for `nodejs`) command, invoke the Gradle wrapper
5
+
in continuous mode:
6
6
7
7
```bash
8
-
./gradlew run --continuous
8
+
# For `browser` project
9
+
./gradlew jsBrowserDevelopmentRun --continuous
10
+
11
+
# For `nodejs` project
12
+
./gradlew jsNodeDevelopmentRun --continuous
9
13
```
10
14
11
-
If you are working in IntelliJ IDEA, you can pass the same flag via the _run configuration_. After running the Gradle
12
-
`run` task for the first time from the IDE, IntelliJ IDEA automatically generates a run configuration for it,
13
-
which you can edit:
15
+
If you are working in IntelliJ IDEA, you can pass the same flag via the list of run configurations. After running the
16
+
`jsBrowserDevelopmentRun` Gradle task for the first time from the IDE, IntelliJ IDEA automatically generates a run configuration for it,
17
+
which you can edit at the top toolbar:
14
18
15
19
{width=700}
16
20
17
-
Enabling continuous mode via the **Run/Debug Configurations** dialog is as easy as adding the `--continuous` flag to the
21
+
Enable continuous mode via the **Run/Debug Configurations** dialog by adding the `--continuous` flag to the
18
22
arguments for the run configuration:
19
23
20
24
{width=700}
@@ -23,6 +27,6 @@ When executing this run configuration, you can note that the Gradle process cont
23
27
24
28
{width=700}
25
29
26
-
Once a change has been detected, the program will be recompiled automatically. If you still have the page open in the browser,
27
-
the development server will trigger an automatic reload of the page, and the changes will become visible.
28
-
This is thanks to the integrated `webpack-dev-server` that is managed by the Kotlin Multiplatform Gradle plugin.
30
+
Once a change has been detected, the program is recompiled automatically. If you still have the web page open in the browser,
31
+
the development server triggers an automatic reload of the page, and the changes become visible.
32
+
This is thanks to the integrated [`webpack-dev-server`](https://webpack.js.org/configuration/dev-server/) that is managed by the [Kotlin Multiplatform Gradle plugin](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-dsl-reference.html).
0 commit comments