[Gradle, JS] Fix source map support initializing for nodejs
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ class NpmVersions {
|
||||
// https://github.com/webpack-contrib/source-map-loader/pull/91
|
||||
val kotlinSourceMapLoader = KotlinGradleNpmPackage("source-map-loader")
|
||||
val sourceMapLoader = NpmPackageVersion("source-map-loader", "0.2.4")
|
||||
val sourceMapSupport = NpmPackageVersion("source-map-support", "0.5.13")
|
||||
val sourceMapSupport = NpmPackageVersion("source-map-support", "0.5.16")
|
||||
|
||||
val mocha = NpmPackageVersion("mocha", "6.2.2")
|
||||
|
||||
|
||||
+7
-3
@@ -33,16 +33,20 @@ open class NodeJsExec : AbstractExecTask<NodeJsExec>(NodeJsExec::class.java), Re
|
||||
override val requiredNpmDependencies: Collection<RequiredKotlinJsDependency>
|
||||
get() = mutableListOf<RequiredKotlinJsDependency>().also {
|
||||
if (sourceMapStackTraces) {
|
||||
it.add(nodeJs.versions.kotlinJsTestRunner)
|
||||
it.add(nodeJs.versions.sourceMapSupport)
|
||||
}
|
||||
}
|
||||
|
||||
override fun exec() {
|
||||
if (sourceMapStackTraces) {
|
||||
args(
|
||||
val sourceMapSupportArgs = mutableListOf(
|
||||
"--require",
|
||||
compilation.npmProject.require("kotlin-test-js-runner/kotlin-nodejs-source-map-support")
|
||||
compilation.npmProject.require("source-map-support/register.js")
|
||||
)
|
||||
|
||||
args?.let { sourceMapSupportArgs.addAll(it) }
|
||||
|
||||
args = sourceMapSupportArgs
|
||||
}
|
||||
|
||||
super.exec()
|
||||
|
||||
-1
@@ -175,7 +175,6 @@ class KotlinKarma(override val compilation: KotlinJsCompilation) : KotlinJsTestF
|
||||
requiredDependencies.add(versions.webpack)
|
||||
requiredDependencies.add(versions.webpackCli)
|
||||
requiredDependencies.add(versions.kotlinSourceMapLoader)
|
||||
requiredDependencies.add(versions.sourceMapSupport)
|
||||
}
|
||||
|
||||
fun useCoverage(
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
require('source-map-support').install();
|
||||
@@ -15,7 +15,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^10.12.21",
|
||||
"source-map-support": "^0.5.11",
|
||||
"browser-process-hrtime": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -16,26 +16,6 @@ export default [
|
||||
},
|
||||
plugins: plugins()
|
||||
},
|
||||
{
|
||||
input: './nodejs-source-map-support.js',
|
||||
external: ['path', 'fs', 'module'],
|
||||
output: {
|
||||
file: 'lib/kotlin-nodejs-source-map-support.js',
|
||||
format: 'cjs',
|
||||
sourcemap: true
|
||||
},
|
||||
plugins: [
|
||||
nodeResolve({
|
||||
jsnext: true,
|
||||
main: true
|
||||
}),
|
||||
commonjs(),
|
||||
terser({
|
||||
compress: true,
|
||||
sourcemap: true
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
input: './karma.ts',
|
||||
output: {
|
||||
|
||||
@@ -628,14 +628,6 @@ source-map-resolve@^0.5.0:
|
||||
source-map-url "^0.4.0"
|
||||
urix "^0.1.0"
|
||||
|
||||
source-map-support@^0.5.11:
|
||||
version "0.5.12"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599"
|
||||
integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==
|
||||
dependencies:
|
||||
buffer-from "^1.0.0"
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map-support@~0.5.12:
|
||||
version "0.5.13"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932"
|
||||
|
||||
Reference in New Issue
Block a user