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
Compatibility with webpack #1854
Comments
We use browserify https://github.com/GoodBoyDigital/pixi.js/blob/master/package.json#L57-L61 I'm not sure how you would make that webpack compatible, are there any articles on webpack running browserify transforms? |
@drkibitz @englercj Thanks for the hint, I was able to get started with Pixi+Webpack using transform-loader+json-loader. @fusepilot Here is the webpack config I am using. |
I couldn't get @mking's config to work when using Babel. I had to move brfs to postLoaders, but now it works: https://gist.github.com/oal/898df82fa64e54dd16d0 |
Closing since this seems answered. |
I wasn't able to solve a problem where I ended up using the built version of pixi.js like
|
I guess you might need some kind of plugin for webpack for it to support .json require loading? Node/browserify support it natively. |
@englercj It's supported when |
Hmm, weird. Yeah sorry i'm not familiar with it either :/ |
Webpack has an option to load "pre-packed" libraries without parse it (like pixi.js), just add noParse to your module section at webpack config, something like that:
This snippet must solve the problem with the internal requires. |
This is the most direct and simple example of configuring webpack with PIXI that I found. |
Maybe related issues with PIXI through Webpack pixijs/pixijs#1854 pixijs/pixijs#2078 Where they set node: { fs: "empty" }
This gist is the most simple webpack + pixi.js config : https://gist.github.com/mjackson/ecd3914ebee934f4daf4 ( with great comments ) |
the gist linked above suffers from a bug related to 5a53e38 - pixi's version number is reported as
{
include: path.resolve(__dirname, 'node_modules/pixi.js'),
loader: 'transform/cacheable?browserify-versionify'
} @mjackson mentioning here because gist comments don't send notifications apparently 😞 |
Just ran into this problem. Thanks a lot for the solution! |
Here is a working configuration for Webpack / Typescript and PixiJS :-). https://gist.github.com/Nek-/b9775f7a88eb896db8afc37a89db3771 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
var PIXI = require('pixi.js');
First attempt gave me a bunch of webpack errors:
So I set
node: { fs: "empty" }
in webpack's config and that got rid of the above errors.But then this error:
So I added json-loader to webpack's config.
Success. Would be nice if this worked out of box though.
The text was updated successfully, but these errors were encountered: