pa-dieter / kfc-plugins

Kotlin/JS Fast Configuration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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("js") version "1.5.30"
    id("com.github.turansky.kfc.webpack") version "4.30.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

  • Fast build
  • Modularity

Decision

  • Disable DCE
  • Disable Webpack build
  • Kotlin/JS target - commonjs

build.gradle.kts

plugins {
    kotlin("js") version "1.5.30"
    id("com.github.turansky.kfc.library") version "4.30.0"
}

About

Kotlin/JS Fast Configuration

License:Apache License 2.0


Languages

Language:Kotlin 99.8%Language:Shell 0.2%