Remove source map support runtime for webpack

- Browsers support source maps OOB
- source-map-support is necessary to install to make a sense, but now we only include it in bundle w/o installing
- Additional webpack's options like output.library doesn't works with multiple entries if last item is not bundled library

#KT-33288 fixed
This commit is contained in:
Ilya Goncharov
2019-09-12 19:18:32 +03:00
parent 8614323f80
commit 2fe5feac94
2 changed files with 1 additions and 19 deletions
@@ -117,8 +117,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
configDirectory = configDirectory,
bundleAnalyzerReportDir = if (report) reportDir else null,
devServer = devServer,
sourceMaps = sourceMaps,
sourceMapsRuntime = sourceMaps
sourceMaps = sourceMaps
)
)
@@ -28,7 +28,6 @@ data class KotlinWebpackConfig(
var devServer: DevServer? = null,
val showProgress: Boolean = false,
val sourceMaps: Boolean = false,
val sourceMapsRuntime: Boolean = false,
val export: Boolean = true,
val progressReporter: Boolean = false,
val progressReporterPathFilter: String? = null
@@ -43,7 +42,6 @@ data class KotlinWebpackConfig(
if (sourceMaps) {
it.add(versions.sourceMapLoader)
it.add(versions.sourceMapSupport)
}
if (devServer != null) {
@@ -106,7 +104,6 @@ data class KotlinWebpackConfig(
appendEntry()
appendSourceMaps()
appendSourceMapsRuntime()
appendDevServer()
appendReport()
appendFromConfigDir()
@@ -180,20 +177,6 @@ data class KotlinWebpackConfig(
appendln()
}
private fun Appendable.appendSourceMapsRuntime() {
if (!sourceMapsRuntime) return
//language=JavaScript 1.8
appendln(
"""
// source maps runtime
if (!config.entry) config.entry = [];
config.entry.push('source-map-support/browser-source-map-support.js');
""".trimIndent()
)
}
private fun Appendable.appendSourceMaps() {
if (!sourceMaps) return