Skip to content

Commit 8977ba7

Browse files
authored
Merge pull request #16 from zakjan/patch-1
Remove multiline comments with compress option
2 parents 74f3baa + 7769549 commit 8977ba7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { compile } = require('glslify');
1010

1111
function compressShader(code) {
1212
let needNewline = false;
13-
return code.replace(/\\(?:\r\n|\n\r|\n|\r)|\/\*.*?\*\/|\/\/(?:\\(?:\r\n|\n\r|\n|\r)|[^\n\r])*/g, '').split(/\n+/).reduce((result, line) => {
13+
return code.replace(/\\(?:\r\n|\n\r|\n|\r)|\/\*.*?\*\/|\/\/(?:\\(?:\r\n|\n\r|\n|\r)|[^\n\r])*/gs, '').split(/\n+/).reduce((result, line) => {
1414
line = line.trim().replace(/\s{2,}|\t/, ' ');
1515
if (line.charAt(0) === '#') {
1616
if (needNewline) {

0 commit comments

Comments
 (0)