i'm migrating from kotlin2js/frontend/dce to org.j...
# javascript
j
i'm migrating from kotlin2js/frontend/dce to org.jetbrains.kotlin.js. How do I set webpack into production mode?
t
webpack.config.d
folder + following script
Copy code
config.mode = 'production'
Do you have single subproject?
i
Since 1.3.70 (in eap stage now) webpack has production mode and DCE integrated by default for build, and development for dev-server Additionally, you can set mode via dsl
Copy code
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.Mode
...
kotlin {
   target {
       webpackTask {
          mode = Mode.DEVELOPMENT
       }
   }
}
Before 1.3.70 you need set it via
webpack.config.d
and create js script with content
Copy code
config.mode = 'production`
as @turansky said
👀 1
👍 1
j
Thanks! Went with the EAP since I was planning on doing that next anyway. (And no I have about 8 JS Gradle subprojects in this repo but only 3 are leafs that need production bundles)
t
If you don't need DCE & Webpack for some of then than you can use
library
plugin https://github.com/turansky/kfc-plugins#library