Skip to content

Commit f0d7a58

Browse files
authored
Fix sourcesContent (#177)
* Fix sourcesContent
1 parent 86ddc14 commit f0d7a58

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# svelte-loader changelog
22

3+
## 3.1.1 (Unreleased)
4+
5+
* Fix empty sourcesContent ([#177](https://github.com/sveltejs/svelte-loader/pull/177))
6+
37
## 3.1.0
48

59
* Pass preprocessor source maps to compiler ([#172](https://github.com/sveltejs/svelte-loader/pull/172))

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ module.exports = function(source, map) {
5050
const compiled = compile(processed.toString(), compileOptions);
5151
let { js, css, warnings } = compiled;
5252

53+
if (!js.map.sourcesContent) js.map.sourcesContent = [ source ];
54+
5355
warnings.forEach(
5456
options.onwarn
5557
? warning => options.onwarn(warning, handleWarning)

0 commit comments

Comments
 (0)