Closed gilshallem closed 6 years ago
You'll need to define both WEBGL_RENDERER
and CANVAS_RENDERER
booleans, somewhere in your app configuration, to enable either renderer for you game.
I don't know how you'd do that in Meteor as I've never tried it myself. I know that for Webpack you'll face a similar problem, but you can solve it by adding webpack.DefinePlugin
to define those two values in the configuration.
I tried to do exactly that (use webpack.DefinePlugin
) but it only seems to work in my own project's source files and NOT anything from node_modules
. I couldn't find any literature on this but I think this behavior is by design, since otherwise it would run the risk of corrupting third-party code.
EDIT: I tried it in a different project and now it works...
Why do these need to be global variable in the first place? Using process.env, part of the config, etc. Anything is better than relying on a webpack plugin.
These are not global variables. At no point do they ever get exported into the global scope. They're build time flags that are replaced in the final bundle with simple booleans. What they provide are build time conditional insertion of code, something that ES modules alone cannot do.
Even if we stored the values inside process.env
instead it would still need to use webpack.DefinePlugin to expose them. If this 'spaghetti' is good enough for Angular's build process, it's good enough for us.
Hi, I am trying to use phaser with meteorjs
i installed phaser via: meteor npm install phaser@beta
import Phaser from 'phaser';
Browser (chrome) console: