未验证 提交 09e1fde7 编写于 作者: M Michael Herzog 提交者: GitHub

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

JSM: Update Modularize Script to Produce Usable Modules
...@@ -44,9 +44,9 @@ function convert( path, ignoreList ) { ...@@ -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 ) { ...@@ -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} };\n`;
var output = contents.replace( '_IMPORTS_', imports ) + '\n' + exports; var output = contents.replace( '_IMPORTS_', imports ) + '\n' + exports;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册