Skip to content

Commit e0c4c6c

Browse files
committed
Fix external source filename
1 parent e7b913b commit e0c4c6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/process.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ function processScript(scriptPart, filePath, config) {
3131
return null
3232
}
3333

34-
let externalSrc = null
34+
let content = scriptPart.content
35+
let filename = filePath
3536
if (scriptPart.src) {
36-
scriptPart.content = loadSrc(scriptPart.src, filePath)
37-
externalSrc = scriptPart.content
37+
content = loadSrc(scriptPart.src, filePath)
38+
filename = scriptPart.src
3839
}
3940

4041
const vueJestConfig = getVueJestConfig(config)
4142
const transformer = resolveTransformer(scriptPart.lang, vueJestConfig)
4243

43-
const result = transformer.process(scriptPart.content, filePath, config)
44+
const result = transformer.process(content, filename, config)
4445
result.code = stripInlineSourceMap(result.code)
4546
result.map = mapLines(scriptPart.map, result.map)
46-
result.externalSrc = externalSrc
4747
return result
4848
}
4949

0 commit comments

Comments
 (0)