Creating a Kotlin project with a JavaScript target

To start a new Kotlin project that targets JavaScript, perform the following steps:

  1. Open up IntelliJ IDEA and select Create New Project:

  1. Navigate to the Kotlin project templates in the left-hand side of the dialog, select JS | IDEA, and then click NEXT. This will ensure that our newly created project is configured to target JavaScript using the IntelliJ IDEA build system:

  1. Next, we set our project name and project location. You can keep the Project SDK and Kotlin JS library fields as their default values unless you require a specific version of Kotlin. Once you've updated your name and project directory, click on FINISH:

At this point, we should now have an empty Kotlin project. Notice how the project is structured. There should be three elements in the root directory:

In the next section, we'll add a Hello World example in Kotlin to understand how to start building Kotlin for JavaScript.