瀏覽代碼

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

Bazgar Tom 6 年之前
父節點
當前提交
b29d7a389c
共有 1 個文件被更改,包括 2 次插入1 次删除
  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