https://kotlinlang.org logo
#javascript
Title
# javascript
n

natpryce

03/07/2023, 5:33 PM
Hi. How do I use the new IR compiler from the command-line?
I’m getting the build error
This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release.
Please migrate your project to the new IR-based compiler (https://kotl.in/jsir).
Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle.
You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler.
The Kotlin compilation is one recipe in a large Make build, and it is not practical to convert it to Gradle
j

jw

03/07/2023, 5:35 PM
-Xuse-ir
Wait i think that was for JVM. JS is like -Xir-produce-js
If you run with -X it'll tell you all the options
Or create a Gradle project and run with
--debug
to see the arguments passed to the compiler and then copy them
👍 1
t

turansky

03/07/2023, 11:27 PM
IR
Copy code
./gradlew build -Pkotlin.js.compiler=ir
Legacy
Copy code
./gradlew build -Pkotlin.js.compiler=legacy
j

jw

03/08/2023, 12:48 AM
That is Gradle. This person is using Make and the command-line compiler.
😞 1
3 Views