Skip to content

Commit

Permalink
temporary bugfix for pdfkit version 0.9.0 - issue foliojs/pdfkit#923
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Feb 17, 2019
1 parent 51e33ac commit 6258bd2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,31 @@ module.exports = {
}
]})
},

/* temporary bugfix for pdfkit version 0.9.0 - issue https://github.com/foliojs/pdfkit/issues/923 */
/* waiting to release included PR https://github.com/foliojs/pdfkit/pull/925 */
{test: /pdfkit[/\\]js[/\\]/, loader: StringReplacePlugin.replace({
replacements: [
{
pattern: "stringBuffer = swapBytes(new Buffer(",
replacement: function () {
return "stringBuffer = swapBytes(Buffer.from(";
}
}
]})
},
{test: /pdfkit[/\\]js[/\\]/, loader: StringReplacePlugin.replace({
replacements: [
{
pattern: "stringBuffer = new Buffer(string, 'ascii');",
replacement: function () {
return "stringBuffer = Buffer.from(string.valueOf(), 'ascii');";
}
}
]})
},
/* *** */

{enforce: 'post', test: /fontkit[/\\]index.js$/, loader: "transform-loader?brfs"},
{enforce: 'post', test: /unicode-properties[/\\]index.js$/, loader: "transform-loader?brfs"},
{enforce: 'post', test: /linebreak[/\\]src[/\\]linebreaker.js/, loader: "transform-loader?brfs"}
Expand Down

0 comments on commit 6258bd2

Please sign in to comment.