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:
+1
-2
@@ -117,8 +117,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
configDirectory = configDirectory,
|
configDirectory = configDirectory,
|
||||||
bundleAnalyzerReportDir = if (report) reportDir else null,
|
bundleAnalyzerReportDir = if (report) reportDir else null,
|
||||||
devServer = devServer,
|
devServer = devServer,
|
||||||
sourceMaps = sourceMaps,
|
sourceMaps = sourceMaps
|
||||||
sourceMapsRuntime = sourceMaps
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
-17
@@ -28,7 +28,6 @@ data class KotlinWebpackConfig(
|
|||||||
var devServer: DevServer? = null,
|
var devServer: DevServer? = null,
|
||||||
val showProgress: Boolean = false,
|
val showProgress: Boolean = false,
|
||||||
val sourceMaps: Boolean = false,
|
val sourceMaps: Boolean = false,
|
||||||
val sourceMapsRuntime: Boolean = false,
|
|
||||||
val export: Boolean = true,
|
val export: Boolean = true,
|
||||||
val progressReporter: Boolean = false,
|
val progressReporter: Boolean = false,
|
||||||
val progressReporterPathFilter: String? = null
|
val progressReporterPathFilter: String? = null
|
||||||
@@ -43,7 +42,6 @@ data class KotlinWebpackConfig(
|
|||||||
|
|
||||||
if (sourceMaps) {
|
if (sourceMaps) {
|
||||||
it.add(versions.sourceMapLoader)
|
it.add(versions.sourceMapLoader)
|
||||||
it.add(versions.sourceMapSupport)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (devServer != null) {
|
if (devServer != null) {
|
||||||
@@ -106,7 +104,6 @@ data class KotlinWebpackConfig(
|
|||||||
|
|
||||||
appendEntry()
|
appendEntry()
|
||||||
appendSourceMaps()
|
appendSourceMaps()
|
||||||
appendSourceMapsRuntime()
|
|
||||||
appendDevServer()
|
appendDevServer()
|
||||||
appendReport()
|
appendReport()
|
||||||
appendFromConfigDir()
|
appendFromConfigDir()
|
||||||
@@ -180,20 +177,6 @@ data class KotlinWebpackConfig(
|
|||||||
appendln()
|
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() {
|
private fun Appendable.appendSourceMaps() {
|
||||||
if (!sourceMaps) return
|
if (!sourceMaps) return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user