jasonsturges 10 Report post Posted November 7, 2019 Are there some examples of extending PIXI.utils namespace? Taking a look at Pixi's debugging and editor tools, the Free Transform Tool appears to extend PIXI.utils - cool library, looks pretty alpha without npm or webpack. Just references PIXI in a global scope and attempts to prototype utils. If I want to extend Pixi through utilities, or maybe just provide webpack module libraries through npm, any recommendations such as good example projects to follow? 1 ivan.popelyshev reacted to this Quote Share this post Link to post Share on other sites
ivan.popelyshev 1079 Report post Posted November 7, 2019 Extending such way its supported with webpack is difficult. Most of my plugins work like that: import * as PIXI from "pixi.js"; global.PIXI = PIXI; require("pixi-spine"); then pixi-spine takes global PIXI and adds "PIXI.spine" inside, and also a few methods for existing classes in pixi. You can use the same approach - make a library that works with global pixi. In future we'll provide a way that is free of problems like "there are two versions of pixi in node_modules now", we have some problems with peer dependencies. Right now dont focus on webpack and just do this thing. 1 jasonsturges reacted to this Quote Share this post Link to post Share on other sites
ivan.popelyshev 1079 Report post Posted November 7, 2019 Example of what can go wrong with pixijs + webpack + plugins: https://github.com/pixijs/pixi.js/issues/6208 1 jasonsturges reacted to this Quote Share this post Link to post Share on other sites
jasonsturges 10 Report post Posted November 8, 2019 Interesting - my projects embed Pixi within React lately, but worked well in that ecosystem. Also interested in moving more to TypeScript... been slow to adopt, but I like the language features. Quote Share this post Link to post Share on other sites