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() {


Share this post

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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.