Jump to content

PIXI es6 & Babel


Jonny Shaw
 Share

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!

Link to comment
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.

Link to comment
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).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...