Skip to content

Kotlin/JS Fast Configuration

License

Notifications You must be signed in to change notification settings

turansky/kfc-plugins

Repository files navigation

CI Status CI Status Gradle Plugin Portal Kotlin

Kotlin/JS Fast Configuration

Table of contents

webpack

Goal

  • Non-static webpack configuration
  • Make Kotlin resources content available for Webpack

Task patchWebpackConfig

plugins {
  kotlin("multiplatform") version "2.0.0"
  id("io.github.turansky.kfc.webpack") version "8.1.0"
}

kotlin.js {
    browser()
}

tasks {
    patchWebpackConfig {
        // language=JavaScript
        patch(
            """
            config.output.library.export = ['com', 'example', 'app']
        """)
    }
}

Attention

webpack.config.d directory will be used as temp. Add following .gitignore instruction to exclude directory from Git:

webpack.config.d/

Resources

By default webpack plugin add src/main/resources directory of:

  • Current subproject
  • Dependency subprojects

as Webpack modules.

library

Apply webpack plugin by default

Goal

  • Modularity

Decision

  • Kotlin/JS target - es
  • ES classes - enabled

build.gradle.kts

plugins {
  kotlin("multiplatform") version "2.0.0"
  id("io.github.turansky.kfc.library") version "8.1.0"
}