diff --git a/utils/modularize.js b/utils/modularize.js index abf7cb5919c3f5..ce98ee9d329cb1 100644 --- a/utils/modularize.js +++ b/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;