-
-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: runtime doesn't contain source maps function without `sourceMap: true`
- Loading branch information
1 parent
d779eb1
commit 9f974be
Showing
13 changed files
with
397 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = function cssWithMappingToString(item) { | ||
const [, content, , cssMapping] = item; | ||
|
||
if (typeof btoa === 'function') { | ||
// eslint-disable-next-line no-undef | ||
const base64 = btoa( | ||
unescape(encodeURIComponent(JSON.stringify(cssMapping))) | ||
); | ||
const data = `sourceMappingURL=data:application/json;charset=utf-8;base64,${base64}`; | ||
const sourceMapping = `/*# ${data} */`; | ||
|
||
const sourceURLs = cssMapping.sources.map( | ||
(source) => `/*# sourceURL=${cssMapping.sourceRoot || ''}${source} */` | ||
); | ||
|
||
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); | ||
} | ||
|
||
return [content].join('\n'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.