Browse Source

Fix case where a reference to a THREE object is used without a period after it

Garrett Johnson 6 years ago
parent
commit
d175dab6f1
1 changed files with 3 additions and 3 deletions
  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;
 		return match;
 
 
@@ -83,7 +83,7 @@ function convert( path, ignoreList ) {
 
 
 	var keys = Object.keys( dependencies ).sort().map( value => '\n\t' + value ).toString();
 	var keys = Object.keys( dependencies ).sort().map( value => '\n\t' + value ).toString();
 	var imports = `import {${keys}\n} from "../../../build/three.module.js";`;
 	var imports = `import {${keys}\n} from "../../../build/three.module.js";`;
-	var exports = `export { ${className} }`;
+	var exports = `export { ${className} };`;
 
 
 	var output = contents.replace( '_IMPORTS_', imports ) + '\n' + exports;
 	var output = contents.replace( '_IMPORTS_', imports ) + '\n' + exports;