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:
+1
-1
@@ -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"
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+2
-2
@@ -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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user