nox020189

Using Phaser 3 with RequireJS

Recommended Posts

Previously I had used Phaser 2 with RequireJS by providing a path and export shim, and have found it a common practice when searching for the two libraries together. However, it does not seem to work with Phaser 3 as of right now.

Here is an example of what my RequireJS configuration looks like.

requirejs.config({
  paths: {
    phaser: './vendor/phaser.min'
  },
  shim: {
    phaser: {
      exports: 'Phaser'
    }
  }
});

Within Google Chrome's Developer Tools' Network tab I can confirm that it is grabbing the `phaser.min.js` file, but when I require Phaser and print its value to console it is not an object but `undefined`.

Any suggestions on how I may correct this would be greatly appreciated! :)

Share this post


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

  • Recently Browsing   0 members

    No registered users viewing this page.