Skip to content

boo1ean/molyjamdn

Repository files navigation

molyjamdn

Shitty platformer

Development

During development, an error will be thrown because dist/game.js doesn't exist

However, we check to see if it is loaded and use the dojo loader if it isn't

We also note in the console that is happening

During development, work in the src/ directory and make small modules

You can start a development server with linting and auto-reload using the grunt command in your terminal, which will open your default browser to 0.0.0.0:8000

Your browser will auto-reload when you make changes to files

Building

Once you are ready to deploy your project, you can build with the grunt build command

This command will crawl your dependency tree, starting with src/game.js and build a single file dist/game.js.uncompressed.js

It will also minify your file with Google Closure Compiler into dist/game.js

You shouldn't have to make any changes to your index.html for this file to start working

Removing Build and/or Dependencies

You can remove the files generated by the grunt dojo (dist/ and libs/) by running grunt clean:dist

You can remove deps/ and node_modules/ by running grunt clean:deps

You can remove dist/, libs/, deps/, and node_modules/ by running grunt clean:all

Add coffee build target

compile: {
    files: {
        'path/to/result.js': 'path/to/source.coffee', // 1:1 compile
        'path/to/another.js': ['path/to/sources/*.coffee', 'path/to/more/*.coffee'] // compile and concat into single file
    }
}

To build coffe run: grunt coffee For more details https://github.com/gruntjs/grunt-contrib-coffee