Jump to content

Boiler Plate Grunt for Self Hosting


Recommended Posts

I've created my own variation of the Space Invaders game, but I started with the boiler plate repo on github.
I've updated from melonjs 6.0 to 6.3.

I'm having an issue with the output of the "grunt" command.  Unfortunately the bundling of melon and my game
source files will not run. When execution reaches game.onload(), the console throws an error saying that game is undefined.
Everything works if I just copy my javascript files over and adjust the index.html to load them, instead of the js/app.min.js

My question is, what is the proper way to bundle all the project now, so that I don't have this issue? (Incidentally I was also
seeing an error about drawShape, a function I'm not even using, and that went away if I just used the unbundled and unminified melon.js)


<script type="text/javascript">
    me.device.onReady(function onReady() {


Link to comment
Share on other sites

On a whim I decided to try using webpack instead of grunt.

After a lot of tinkering around, including some refactoring of my code to ES6, I'm able to generate a bundle/dist
that works. The only thing that remains is figuring out how/if I should bother bundling the assets in the data folder.
(Even without that, I"m working on adjusting the webpack config to properly copy the assets)

Link to comment
Share on other sites

  • 1 month later...

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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...