Jump to content

WebStorm2016.2+Phaser+error with require()


Recommended Posts

Friends, greetings to all.
Return to Phaser after a while. I'm working with WebStorm and TypeScript.

I have a problem with importing a class into a .ts (typescript) file:
Import EnemySprite from './classes/EnemySprite';

Translated to javascript:
Var EnemySprite_1 = require ( './ classes / EnemySprite');

The require () function is not recognized, so when I run the game I get the following message in the index.html:
Uncaught ReferenceError: require is not defined

Some help?
Thank you!

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.

×
×
  • Create New...