Skip to content

Commit

Permalink
Fix sourcesContent (#177)
Browse files Browse the repository at this point in the history
* Fix sourcesContent
  • Loading branch information
non25 authored Apr 14, 2021
1 parent 86ddc14 commit f0d7a58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# svelte-loader changelog

## 3.1.1 (Unreleased)

* Fix empty sourcesContent ([#177](https://github.com/sveltejs/svelte-loader/pull/177))

## 3.1.0

* Pass preprocessor source maps to compiler ([#172](https://github.com/sveltejs/svelte-loader/pull/172))
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ module.exports = function(source, map) {
const compiled = compile(processed.toString(), compileOptions);
let { js, css, warnings } = compiled;

if (!js.map.sourcesContent) js.map.sourcesContent = [ source ];

warnings.forEach(
options.onwarn
? warning => options.onwarn(warning, handleWarning)
Expand Down

0 comments on commit f0d7a58

Please sign in to comment.