Pārlūkot izejas kodu

Fix: Incorrect build of threejs on windows (#15383)

Bazgar Tom 6 gadi atpakaļ
vecāks
revīzija
b29d7a389c
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  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