sHAYM4N

PIXI es6 & Babel

Recommended Posts

Hi all

After a few working  projects in PIXI on es5,  we're now starting to try and build a framework using es6 & babel.  We have a boilerplate setup and have got the basics working, though it is slow.  Because PIXI.js modules aren't decoupled, it takes a good 5 seconds+ on a simple project to recompile on each save & refresh the browser.  I understand there is work possibly planned for V5 on this, but are there any workarounds in the meantime anyone has found to make the workflow a little quicker?

Thanks in advance!

Share this post


Link to post
Share on other sites

V5 is de-coupled and you'll be able to embed it in the app. Even then, the size might be a problem if you use not only the core but all meshes and other things. In fact, you can try to use it right now, if you dont use any plugins or ParticleContainer: https://github.com/pixijs/pixi.js/tree/next

As for V4, please use pixi as external lib.

Sarcastically, I wonder why people not build linux kernel^W^W all nodejs system libs through babel. Its obvious that every app has to be built like a single module and put through babel. I guess its because multi-module projects are not known to js world, they're supposed to be discovered next year and edited by alternatively gifted community editors (in the worst meaning, not the good one) to be claimed like JS invention.

Seriously, dont go with the fashion. External modules are ok, better to customize the build for yourself. @cursedcoder and I are trying to fix all the mess in plugins too: https://github.com/gameofbombs/ts-hybrid-test . Its a custom build with lerna system that allows to use namespaces inside the module. We sacrifice internal tree shaking for code readability.

Share this post


Link to post
Share on other sites

Totally agree that external modules are absolutely fine.

I wonder what you're doing though that is causing such horrendous recompile times, I've stuck pixi.js through both Browserify and Webpack and had no issues with incremental builds with no effort on my part at all (the initial build does take a few seconds, but subsequent ones are quick because its only rebuilding stuff that has changed, and your dependencies won't, although that is checked against version number as well).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.