[Gradle, JS] Add generate config only to webpack
This commit is contained in:
+12
-2
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.webpack
|
||||
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Incubating
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.api.internal.file.FileResolver
|
||||
import org.gradle.api.plugins.BasePluginConvention
|
||||
@@ -135,6 +136,10 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
||||
@Input
|
||||
var devtool: String = WebpackDevtool.EVAL_SOURCE_MAP
|
||||
|
||||
@Incubating
|
||||
@Internal
|
||||
var generateConfigOnly: Boolean = false
|
||||
|
||||
private fun createRunner() = KotlinWebpackRunner(
|
||||
compilation.npmProject,
|
||||
configFile,
|
||||
@@ -169,6 +174,11 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
||||
|
||||
val runner = createRunner()
|
||||
|
||||
if (generateConfigOnly) {
|
||||
runner.config.save(configFile)
|
||||
return
|
||||
}
|
||||
|
||||
if (project.gradle.startParameter.isContinuous) {
|
||||
val continuousRunner = runner
|
||||
|
||||
|
||||
Reference in New Issue
Block a user