Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Remove source map strings from inlined css (#919)
Browse files Browse the repository at this point in the history
Source maps do not work for inlined css. So when we concat
the stylesheets for inlining we now remove source map strings.
  • Loading branch information
Adam Tavener committed Apr 21, 2017
1 parent a5613bb commit 640f5a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/lib/stylesheet-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports = {
if (!stylesheets[name]) {
throw new Error(`Stylesheet ${name}.css does not exist`);
}
return str + stylesheets[name];
// remove source maps from inlined css as browser will error
return str + stylesheets[name].replace(/\/\*# sourceMappingURL=.*\*\//, '');
}, '');
concatenatedStylesSizeCache[hash] = calculateSize(concatenatedStylesCache[hash])
}
Expand Down

0 comments on commit 640f5a6

Please sign in to comment.