To start a new Kotlin project that targets JavaScript, perform the following steps:
- Open up IntelliJ IDEA and select Create New Project:
- 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:
- 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:
- The .idea directory for IntelliJ configuration
- An empty src directory
- An .iml file with module configuration
In the next section, we'll add a Hello World example in Kotlin to understand how to start building Kotlin for JavaScript.