RoboSquidTV Posted October 27, 2017 Share Posted October 27, 2017 A bit of a Webpack and ES6 noob here. At the top of my main.js I have: Quote import 'pixi'; import 'p2'; import Phaser from 'phaser' All of which are installed via NPM. I don't have anything in my webpack configuration relevant to this, some posts online I have seen have mentioned methods of doing it that way i guess. Anyway, The webpack build finishes and I get nothing in the browser but I get this console error. Quote phaser.js:23282 Uncaught ReferenceError: PIXI is not defined at phaser.js:23282 at Object.<anonymous> (phaser.js:103061) at Object.module.exports (phaser.js:103063) at __webpack_require__ (bootstrap 2c860b41a8016573ba2d:19) at Object.<anonymous> (app.js:3) at __webpack_require__ (bootstrap 2c860b41a8016573ba2d:19) at module.exports (bootstrap 2c860b41a8016573ba2d:62) at bootstrap 2c860b41a8016573ba2d:62 Link to comment Share on other sites More sharing options...
Andy R Posted October 29, 2017 Share Posted October 29, 2017 webpack gives an option to make imported module as global. I would recommand you to try this instead, it works out of the box : https://github.com/lean/phaser-es6-webpack Link to comment Share on other sites More sharing options...
Recommended Posts