Skip to content

Commit 9ca96a5

Browse files
committed
fix Template.getFunctionContent for windows line breaks
1 parent 91bfd45 commit 9ca96a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/Template.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = class Template extends Tapable {
1818
}
1919

2020
static getFunctionContent(fn) {
21-
return fn.toString().replace(/^function\s?\(\)\s?\{\n?|\n?\}$/g, "").replace(/^\t/mg, "");
21+
return fn.toString().replace(/^function\s?\(\)\s?\{\r?\n?|\r?\n?\}$/g, "").replace(/^\t/mg, "").replace(/\r?\n/g, "\n");
2222
}
2323

2424
static toIdentifier(str) {

0 commit comments

Comments
 (0)