Kaynağa Gözat

Merge pull request #15407 from cadenasgmbh/#15383

Fixed build on windows
Mr.doob 6 yıl önce
ebeveyn
işleme
377cf2eeae
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      rollup.config.js

+ 2 - 1
rollup.config.js

@@ -162,11 +162,12 @@ function glsl() {
 
 
 			if ( /\.glsl.js$/.test( id ) === false ) return;
 			if ( /\.glsl.js$/.test( id ) === false ) return;
 
 
-			code = code.replace( /\`((.*|\n)*)\`/, function ( match, p1 ) {
+			code = code.replace( /\`((.*|\n|\r\n)*)\`/, function ( match, p1 ) {
 
 
 				return JSON.stringify(
 				return JSON.stringify(
 					p1
 					p1
 						.trim()
 						.trim()
+						.replace( /\r/g, '' )
 						.replace( /[ \t]*\/\/.*\n/g, '' ) // remove //
 						.replace( /[ \t]*\/\/.*\n/g, '' ) // remove //
 						.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' ) // remove /* */
 						.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' ) // remove /* */
 						.replace( /\n{2,}/g, '\n' ) // # \n+ to \n
 						.replace( /\n{2,}/g, '\n' ) // # \n+ to \n