[Gradle, JS] Args for webpack

This commit is contained in:
Ilya Goncharov
2020-05-12 17:14:06 +03:00
parent 0a704cf52c
commit b201ff0168
2 changed files with 7 additions and 0 deletions
@@ -123,6 +123,9 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
@Input
var bin: String = "webpack/bin/webpack.js"
@Input
var args: MutableList<String> = mutableListOf()
@Input
var sourceMaps: Boolean = true
@@ -145,6 +148,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
configFile,
execHandleFactory,
bin,
args,
KotlinWebpackConfig(
mode = mode,
entry = entry,
@@ -17,6 +17,7 @@ internal data class KotlinWebpackRunner(
val configFile: File,
val execHandleFactory: ExecHandleFactory,
val tool: String,
val args: List<String>,
val config: KotlinWebpackConfig
) {
fun execute() = npmProject.project.execWithErrorLogger("webpack") {
@@ -43,6 +44,8 @@ internal data class KotlinWebpackRunner(
args.add("--progress")
}
args.addAll(this.args)
npmProject.useTool(execFactory, tool, *args.toTypedArray())
}
}