KT-37587 Karma. Support dynamically created webpack configs
This commit is contained in:
committed by
Ilya Goncharov
parent
7736e5f4a7
commit
4cd4dfee25
+1
-1
@@ -154,7 +154,7 @@ class KotlinKarma(override val compilation: KotlinJsCompilation) :
|
|||||||
requiredDependencies.add(versions.webpack)
|
requiredDependencies.add(versions.webpack)
|
||||||
|
|
||||||
val webpackConfigWriter = KotlinWebpackConfig(
|
val webpackConfigWriter = KotlinWebpackConfig(
|
||||||
configDirectory = project.projectDir.resolve("webpack.config.d").takeIf { it.isDirectory },
|
configDirectory = project.projectDir.resolve("webpack.config.d"),
|
||||||
sourceMaps = true,
|
sourceMaps = true,
|
||||||
devtool = null,
|
devtool = null,
|
||||||
export = false,
|
export = false,
|
||||||
|
|||||||
+1
-1
@@ -108,7 +108,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
get() = destinationDirectory.resolve(outputFileName)
|
get() = destinationDirectory.resolve(outputFileName)
|
||||||
|
|
||||||
open val configDirectory: File?
|
open val configDirectory: File?
|
||||||
@Optional @InputDirectory get() = project.projectDir.resolve("webpack.config.d").takeIf { it.isDirectory }
|
@Optional @InputDirectory get() = project.projectDir.resolve("webpack.config.d")
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
var report: Boolean = false
|
var report: Boolean = false
|
||||||
|
|||||||
+1
-1
@@ -141,7 +141,7 @@ data class KotlinWebpackConfig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun Appendable.appendFromConfigDir() {
|
private fun Appendable.appendFromConfigDir() {
|
||||||
if (configDirectory == null) return
|
if (configDirectory == null || !configDirectory.isDirectory) return
|
||||||
|
|
||||||
appendln()
|
appendln()
|
||||||
appendConfigsFromDir(configDirectory)
|
appendConfigsFromDir(configDirectory)
|
||||||
|
|||||||
Reference in New Issue
Block a user