Gradle, JS, webpack: run js directly (don't use bin script)

On windows, bin script wrapped with bashsh and cmd shell, so node failed
 to run it

#KT-31985 Fixed
This commit is contained in:
ilgonmic
2019-06-16 14:36:31 +03:00
committed by Sergey Rostov
parent a4427773a5
commit 024636f704
3 changed files with 4 additions and 4 deletions
@@ -59,7 +59,7 @@ class KotlinBrowserJs(target: KotlinJsTarget) :
project.getTasksByName(compilation.processResourcesTaskName, false)
)
it.bin = "webpack-dev-server"
it.bin = "webpack-dev-server/bin/webpack-dev-server.js"
it.compilation = compilation
it.description = "start webpack dev server"
@@ -75,7 +75,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
@OutputFile get() = reportDir.resolve("webpack.config.evaluated.js")
@Input
var bin: String = "webpack"
var bin: String = "webpack/bin/webpack.js"
@Input
var sourceMaps: Boolean = true
@@ -16,7 +16,7 @@ internal data class KotlinWebpackRunner(
val npmProject: NpmProject,
val configFile: File,
val execHandleFactory: ExecHandleFactory,
val bin: String,
val tool: String,
val configWriter: KotlinWebpackConfigWriter
) {
fun execute() = npmProject.project.execWithProgress("webpack") {
@@ -43,6 +43,6 @@ internal data class KotlinWebpackRunner(
args.add("--progress")
}
npmProject.useTool(execFactory, ".bin/$bin", *args.toTypedArray())
npmProject.useTool(execFactory, tool, *args.toTypedArray())
}
}