[Gradle, JS] Webpack devtool as a String
#KT-37635 fixed
This commit is contained in:
+1
-1
@@ -130,7 +130,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
||||
var devServer: KotlinWebpackConfig.DevServer? = null
|
||||
|
||||
@Input
|
||||
var devtool: KotlinWebpackConfig.Devtool = KotlinWebpackConfig.Devtool.EVAL_SOURCE_MAP
|
||||
var devtool: String = KotlinWebpackConfig.Devtool.EVAL_SOURCE_MAP
|
||||
|
||||
private fun createRunner() = KotlinWebpackRunner(
|
||||
compilation.npmProject,
|
||||
|
||||
+5
-5
@@ -27,7 +27,7 @@ data class KotlinWebpackConfig(
|
||||
val bundleAnalyzerReportDir: File? = null,
|
||||
val reportEvaluatedConfigFile: File? = null,
|
||||
val devServer: DevServer? = null,
|
||||
val devtool: Devtool? = Devtool.EVAL_SOURCE_MAP,
|
||||
val devtool: String? = Devtool.EVAL_SOURCE_MAP,
|
||||
val showProgress: Boolean = false,
|
||||
val sourceMaps: Boolean = false,
|
||||
val export: Boolean = true,
|
||||
@@ -79,9 +79,9 @@ data class KotlinWebpackConfig(
|
||||
val contentBase: List<String>
|
||||
) : Serializable
|
||||
|
||||
enum class Devtool(val code: String) {
|
||||
EVAL_SOURCE_MAP("eval-source-map"),
|
||||
SOURCE_MAP("source-map")
|
||||
object Devtool {
|
||||
val EVAL_SOURCE_MAP = "eval-source-map"
|
||||
val SOURCE_MAP = "source-map"
|
||||
}
|
||||
|
||||
fun save(configFile: File) {
|
||||
@@ -199,7 +199,7 @@ data class KotlinWebpackConfig(
|
||||
use: ["kotlin-source-map-loader"],
|
||||
enforce: "pre"
|
||||
});
|
||||
config.devtool = ${devtool?.code?.let { "'$it'" } ?: false};
|
||||
config.devtool = ${devtool?.let { "'$it'" } ?: false};
|
||||
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user