kfc-plugins
kfc-plugins copied to clipboard
Kotlin/JS Fast Configuration
Kotlin/JS Fast Configuration
Table of contents
- Plugins
-
webpack
- Resources
-
library
-
webpack
Goal
- Non-static webpack configuration
- Make Kotlin
resources
content available for Webpack
Task patchWebpackConfig
plugins {
kotlin("js") version "1.7.10"
id("io.github.turansky.kfc.webpack") version "5.62.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.7.10"
id("io.github.turansky.kfc.library") version "5.62.0"
}