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

Add AMD support #53

Closed
koutoftimer opened this issue Dec 23, 2017 · 5 comments
Closed

Add AMD support #53

koutoftimer opened this issue Dec 23, 2017 · 5 comments

Comments

@koutoftimer
Copy link

It is more requirement rather than a feature request.

Lets take a look at pixi-plugin-example. As you can see, at this lines plugin have to be attached to global PIXI variable as well as to be exported as a standalone module with its dependencies. At some point, this repo\plugin brokes one of the main approaches of how pixi.js is functioning.

Currently, there are a lot of module loaders that are built on top of AMD. I'm one of that users. Solution for me could be:

  • Remove module loading (definition, dependency management, etc.) from the whole project - totally not what I'll do.
  • Replace pixi-sound with some other sound library that is not part of pixi-* package.
  • Add AMD support to this plugin ASAP.
@koutoftimer
Copy link
Author

Sorry, my fault, bad requirejs config.

@koutoftimer
Copy link
Author

In order to use pixi-sound with requirejs you have to specify its dependencies manually with shim like this

requirejs.config({
	paths: {
		'pixi': '../node_modules/pixi.js/dist/pixi.min',
		'pixi-sound': '../node_modules/pixi-sound/dist/pixi-sound'
	},
	shim: {
		'pixi-sound': {
			deps: ['pixi']
		}
	}
})

@koutoftimer
Copy link
Author

@bigtimebuddy Perhaps, this can be added to wiki or readme in order to prevent similar issues from creating.

@bigtimebuddy
Copy link
Member

Will do! Thanks for investigating.

@bigtimebuddy
Copy link
Member

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

No branches or pull requests

2 participants