@@ -82,20 +82,22 @@ class JsSource(val srcDir: File, val projectDir: Path, val source: Source) {
8282 }
8383 }
8484
85- private def constructSourceFilePath (sourceFileName : String ): File = sourceFileName match {
86- case _ if absoluteFilePath.contains(NuxtTranspiler .NUXT_FOLDER ) && srcDir.path.compareTo(projectDir) == 0 =>
85+ private def constructSourceFilePath (sourceFileName : String ): File = {
86+ if (sourceFileName.isEmpty) {
87+ srcDir / source.getName
88+ } else if (absoluteFilePath.contains(NuxtTranspiler .NUXT_FOLDER ) && srcDir.path.compareTo(projectDir) == 0 ) {
8789 // For nuxt-js transpilation we have the same src and project dir and we need some special handling here
8890 if (sourceFileName.startsWith(WEBPACK_PREFIX )) {
8991 val replacedName = FileUtils .cleanPath(sourceFileName.replace(WEBPACK_PREFIX , " " ))
9092 srcDir / replacedName.substring(replacedName.indexOf(" /" ) + 1 )
9193 } else {
9294 File (absoluteFilePath).parent / sourceFileName
9395 }
94- case _ if sourceFileName.startsWith(WEBPACK_PREFIX ) =>
96+ } else if ( sourceFileName.startsWith(WEBPACK_PREFIX )) {
9597 // Additionally, source map files coming from webpack (e.g., from Vue transpilation) are somewhat hidden
9698 val replacedName = sourceFileName.replace(WEBPACK_PREFIX , " " )
9799 srcDir / replacedName.substring(replacedName.indexOf(" /" ) + 1 )
98- case _ =>
100+ } else {
99101 val cleanedPath = FileUtils .cleanPath(sourceFileName)
100102 // having "/" here is fine as JS source maps always have platform independent path separators
101103 val lookupPath = if (cleanedPath.contains(" /" + srcDir.name + " /" )) {
@@ -115,6 +117,7 @@ class JsSource(val srcDir: File, val projectDir: Path, val source: Source) {
115117 }
116118 }
117119 srcFilePath
120+ }
118121 }
119122
120123 private def sourceMapOrigin (): Option [SourceMapOrigin ] = {
0 commit comments