Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Built UMD File Readability #15543

Merged
merged 2 commits into from
Jan 8, 2019

Conversation

gkjohnson
Copy link
Collaborator

Per the discussion in #15526:

Replace the three_module_js local UMD variable name with THREE to retain the source readability. Also remove the addition of the __esModule variable onto THREE.

This uses the generateBundle Rollup plugin hook to replace the three_module_js variable name with THREE. Unfortunately I didn't see a better way to control that variable name in Rollup so this is a pretty non discriminating find and replace in the file but given the code style expectations in the repo I don't think it should be a problem.

You can see the new built GLTFLoader code here: https://github.com/gkjohnson/three.js/blob/rollup-jsm-examples-output/examples/js/loaders/GLTFLoader.js

@gkjohnson gkjohnson changed the title Update UMD File Readability Update Built UMD File Readability Jan 8, 2019
@@ -30,7 +44,8 @@ function createOutput( file ) {
banner:
'/**\n' +
` * Generated from '${ path.relative( '.', inputPath.replace( /\\/, '/' ) ) }'\n` +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex appears to be replacing \ with /, but the output still shows \https://github.com/gkjohnson/three.js/blob/rollup-jsm-examples-output/examples/js/loaders/GLTFLoader.js#L2. Is this working as intended?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this working as intended?

Nope! (fixed)

@mrdoob mrdoob added this to the r101 milestone Jan 8, 2019
@mrdoob mrdoob merged commit 0d99e49 into mrdoob:dev Jan 8, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jan 8, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants