Browse Source

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

Bazgar Tom 6 years ago
parent
commit
b29d7a389c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      rollup.config.js

+ 2 - 1
rollup.config.js

@@ -162,11 +162,12 @@ function glsl() {
 
 			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(
 					p1
 						.trim()
+						.replace( /\r/g, '' )
 						.replace( /[ \t]*\/\/.*\n/g, '' ) // remove //
 						.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' ) // remove /* */
 						.replace( /\n{2,}/g, '\n' ) // # \n+ to \n