Skip to content

Commit

Permalink
fix(translator-default): issue with inline sourcmeaps and virtual files
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Apr 5, 2021
1 parent 9c31b32 commit 94ce0e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/translator-default/src/util/add-dependencies.js
Expand Up @@ -109,13 +109,13 @@ export default (entryFile, isHydrate) => {
map = s.snip(dep.startPos, dep.endPos).generateMap();

if (sourceMaps === "inline" || sourceMaps === "both") {
code += dep.style
? `\n/*# sourceMappingURL=${map.toUrl()}*/`
: `\n//# sourceMappingURL=${map.toUrl()}`;

if (sourceMaps === "inline") {
map = undefined;
}

code += virtualPath.endsWith(".css")
? `\n/*# sourceMappingURL=${map.toUrl()}*/`
: `\n//# sourceMappingURL=${map.toUrl()}`;
}
}

Expand Down

0 comments on commit 94ce0e1

Please sign in to comment.