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

Expose the Phaser UI namespace. #1

Closed
wants to merge 2 commits into from
Closed

Expose the Phaser UI namespace. #1

wants to merge 2 commits into from

Conversation

rblopes
Copy link

@rblopes rblopes commented Feb 17, 2017

Saw your post at HTML5 Gamedev Forums.

Tried running the sample project, but got the "class extending undefined" exception thing. This is because only builds including Arcade Physics have the Particles system included. So, you must use to the AP enabled builds for testing those.

As for the Webpack you need to expose the namespace of your library to use it, so at least the output.library option must be present (more info here).

Good luck with your project.

@JarLowrey
Copy link
Owner

@rblopes thanks for all your help! I had no idea about the arcade physics, thats a big insight. I guess I won't include Stars if it is Phaser-platform specific (plus most projects wouldn't need it, it was more for testing).

I had discovered the bit about libraryTarget, though I'm not sure of the differences between them all (amd, commonjs, commonjs2, commonjs-module, umd, this, var). I know they are different JS file import specifications but not sure which one I need. My current issue is that if I incorporate these changes, no more errors are thrown in my test project but I cannot seem to import my little library. Using import PhaserUI from 'phaser-ui'; in the Game state and logging the output results in an empty object. Any idea why that might be?

@JarLowrey
Copy link
Owner

Oh actually I was making a silly typing error, this works!! Thank you x1,000,000!

@JarLowrey
Copy link
Owner

ca66f94

@JarLowrey JarLowrey closed this Feb 17, 2017
@rblopes rblopes deleted the fix-webpack-library branch April 24, 2017 23:26
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.

None yet

2 participants