Skip to content

Commit

Permalink
Bump to 1.1.2, work around rollup/rollup#1104
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanSanchez committed Nov 10, 2016
1 parent c7ae6a5 commit 24d64f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# rollup-plugin-file-as-blob


## 1.1.2

* Work around rollup bug https://github.com/rollup/rollup/issues/1104

## 1.1.1

* Fixed replacement of newlines and double quotes in text files in non-es builds (were breaking blobbing .js files)
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-file-as-blob",
"version": "1.1.1",
"version": "1.1.2",
"description": "Import any (binary) file as a blob URL.",
"main": "dist/rollup-plugin-file-as-blob.cjs.js",
"jsnext:main": "dist/rollup-plugin-file-as-blob.es.js",
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Expand Up @@ -47,8 +47,11 @@ export default function fileAsBlob ( options = {} ) {
// Unfortunately buble+rollup will create code that chokes
// with newlines/quotes when the contents are read from
// a file
data = data.replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/"/g, '\\"');
code = `export default __$strToBlobUri("${data}", "${mime}", false);`;
data = data.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/"/g, '\\"')
.replace(/sourceMappingURL/g, 'sourceMap" + "pingURL');
code = "export default __$strToBlobUri(\"" + data + "\", \"" + mime + "\", false);";
}

return res({ code: code, map: { mappings: '' } });
Expand Down

0 comments on commit 24d64f5

Please sign in to comment.