Skip to content

Fix task names in the continuous compilation doc #4931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: kotlin-js-doc-update
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 15 additions & 11 deletions docs/topics/js/dev-server-continuous-compilation.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
[//]: # (title: Development server and continuous compilation)

Instead of manually compiling and executing a Kotlin/JS project every time you want to see the changes you made,
you can use the _continuous compilation_ mode. Instead of using the regular `run` command, invoke the Gradle wrapper
in _continuous_ mode:
Instead of manually compiling and running your Kotlin/JS project each time you want to see the changes you made,
you can use the _continuous compilation_ mode. Rather than using the regular `jsBrowserDevelopmentRun` (for `browser`) and `jsNodeDevelopmentRun` (for `nodejs`) command, invoke the Gradle wrapper
in continuous mode:

```bash
./gradlew run --continuous
# For `browser` project
./gradlew jsBrowserDevelopmentRun --continuous

# For `nodejs` project
./gradlew jsNodeDevelopmentRun --continuous
```

If you are working in IntelliJ IDEA, you can pass the same flag via the _run configuration_. After running the Gradle
`run` task for the first time from the IDE, IntelliJ IDEA automatically generates a run configuration for it,
which you can edit:
If you are working in IntelliJ IDEA, you can pass the same flag via the list of run configurations. After running the
`jsBrowserDevelopmentRun` Gradle task for the first time from the IDE, IntelliJ IDEA automatically generates a run configuration for it,
which you can edit at the top toolbar:

![Editing run configurations in IntelliJ IDEA](edit-configurations.png){width=700}

Enabling continuous mode via the **Run/Debug Configurations** dialog is as easy as adding the `--continuous` flag to the
Enable continuous mode via the **Run/Debug Configurations** dialog by adding the `--continuous` flag to the
arguments for the run configuration:

![Adding the continuous flag to a run configuration in IntelliJ IDEA](run-debug-configurations.png){width=700}
Expand All @@ -23,6 +27,6 @@ When executing this run configuration, you can note that the Gradle process cont

![Gradle waiting for changes](waiting-for-changes.png){width=700}

Once a change has been detected, the program will be recompiled automatically. If you still have the page open in the browser,
the development server will trigger an automatic reload of the page, and the changes will become visible.
This is thanks to the integrated `webpack-dev-server` that is managed by the Kotlin Multiplatform Gradle plugin.
Once a change has been detected, the program is recompiled automatically. If you still have the web page open in the browser,
the development server triggers an automatic reload of the page, and the changes become visible.
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).