Преглед изворни кода

Merge pull request #15582 from gkjohnson/fix-modularize-script

JSM: Update Modularize Script to Produce Usable Modules
Michael Herzog пре 6 година
родитељ
комит
09e1fde724
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      utils/modularize.js

+ 3 - 3
utils/modularize.js

@@ -44,9 +44,9 @@ function convert( path, ignoreList ) {
 
 	} );
 
-	contents = contents.replace( /THREE\.([a-zA-Z0-9]+)\./g, function ( match, p1 ) {
+	contents = contents.replace( /THREE\.([a-zA-Z0-9]+)(\.{0,1})/g, function ( match, p1, p2 ) {
 
-		if ( p1 === className ) return `${p1}.`;
+		if ( p1 === className ) return `${p1}${p2}`;
 
 		return match;
 
@@ -83,7 +83,7 @@ function convert( path, ignoreList ) {
 
 	var keys = Object.keys( dependencies ).sort().map( value => '\n\t' + value ).toString();
 	var imports = `import {${keys}\n} from "../../../build/three.module.js";`;
-	var exports = `export { ${className} }`;
+	var exports = `export { ${className} };\n`;
 
 	var output = contents.replace( '_IMPORTS_', imports ) + '\n' + exports;