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

Pixi.js and pixi-spine uses different core modules #451

Open
SerG-Y opened this issue Jul 29, 2022 · 3 comments
Open

Pixi.js and pixi-spine uses different core modules #451

SerG-Y opened this issue Jul 29, 2022 · 3 comments

Comments

@SerG-Y
Copy link
Contributor

SerG-Y commented Jul 29, 2022

The issue is that pixi.js imports the display.js module but pixi-spine imports display.mjs. My problem is that mixins (from @pixi/events or @pixi/interaction) does not apply to the spine display objects. I think it's related to latest pixi version and this PR pixijs/pixijs#8505

Pixi.js: v6.5.1
pixi-spine: v3.0.16
typescript: v4.7.4

tsconfig info:
"module": "commonjs",
"moduleResolution": "node"

@ivanpopelyshev
Copy link
Collaborator

I'm not proficient in modules, what should I do with it?

@SerG-Y
Copy link
Contributor Author

SerG-Y commented Jul 29, 2022

@ivanpopelyshev it's a good question :)
I guess adding exports to package.json (for all pixi-spine packages) should help at least it did a trick for me. Honestly, I am also not a big modules expert @bigtimebuddy maybe you can give some advice here. Thanks!
Also, I can create PR if it's needed.

"exports": {
	".": {
		"import": {
			"types": "./index.d.ts",
			"default": "./lib/base.es.js"
		},
		"require": {
			"types": "./index.d.ts",
			"default": "./dist/base.js"
		}
	}
},

@SerG-Y
Copy link
Contributor Author

SerG-Y commented Aug 1, 2022

I did some research and I think the solution with adding exports to package.json for all pixi-spine packages is a good solution and it's the same as pixi.js has. Also, as another solution setting resolve.mainFields as ['main'] for webpack config resolve this issue.
@ivanpopelyshev do you want me to create PR?

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