[Gradle, JS] Args for webpack
This commit is contained in:
+4
@@ -123,6 +123,9 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
@Input
|
@Input
|
||||||
var bin: String = "webpack/bin/webpack.js"
|
var bin: String = "webpack/bin/webpack.js"
|
||||||
|
|
||||||
|
@Input
|
||||||
|
var args: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
var sourceMaps: Boolean = true
|
var sourceMaps: Boolean = true
|
||||||
|
|
||||||
@@ -145,6 +148,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
configFile,
|
configFile,
|
||||||
execHandleFactory,
|
execHandleFactory,
|
||||||
bin,
|
bin,
|
||||||
|
args,
|
||||||
KotlinWebpackConfig(
|
KotlinWebpackConfig(
|
||||||
mode = mode,
|
mode = mode,
|
||||||
entry = entry,
|
entry = entry,
|
||||||
|
|||||||
+3
@@ -17,6 +17,7 @@ internal data class KotlinWebpackRunner(
|
|||||||
val configFile: File,
|
val configFile: File,
|
||||||
val execHandleFactory: ExecHandleFactory,
|
val execHandleFactory: ExecHandleFactory,
|
||||||
val tool: String,
|
val tool: String,
|
||||||
|
val args: List<String>,
|
||||||
val config: KotlinWebpackConfig
|
val config: KotlinWebpackConfig
|
||||||
) {
|
) {
|
||||||
fun execute() = npmProject.project.execWithErrorLogger("webpack") {
|
fun execute() = npmProject.project.execWithErrorLogger("webpack") {
|
||||||
@@ -43,6 +44,8 @@ internal data class KotlinWebpackRunner(
|
|||||||
args.add("--progress")
|
args.add("--progress")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args.addAll(this.args)
|
||||||
|
|
||||||
npmProject.useTool(execFactory, tool, *args.toTypedArray())
|
npmProject.useTool(execFactory, tool, *args.toTypedArray())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user