Skip to content

Commit 09e1fde

Browse files
authored
Merge pull request #15582 from gkjohnson/fix-modularize-script
JSM: Update Modularize Script to Produce Usable Modules
2 parents a65a7ce + c57b480 commit 09e1fde

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/modularize.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ function convert( path, ignoreList ) {
4444

4545
} );
4646

47-
contents = contents.replace( /THREE\.([a-zA-Z0-9]+)\./g, function ( match, p1 ) {
47+
contents = contents.replace( /THREE\.([a-zA-Z0-9]+)(\.{0,1})/g, function ( match, p1, p2 ) {
4848

49-
if ( p1 === className ) return `${p1}.`;
49+
if ( p1 === className ) return `${p1}${p2}`;
5050

5151
return match;
5252

@@ -83,7 +83,7 @@ function convert( path, ignoreList ) {
8383

8484
var keys = Object.keys( dependencies ).sort().map( value => '\n\t' + value ).toString();
8585
var imports = `import {${keys}\n} from "../../../build/three.module.js";`;
86-
var exports = `export { ${className} }`;
86+
var exports = `export { ${className} };\n`;
8787

8888
var output = contents.replace( '_IMPORTS_', imports ) + '\n' + exports;
8989

0 commit comments

Comments
 (0)