Skip to content

Instantly share code, notes, and snippets.

@waifung0207
Last active August 29, 2015 14:03
Show Gist options
  • Save waifung0207/e5c435380d37dfb25d9f to your computer and use it in GitHub Desktop.
Save waifung0207/e5c435380d37dfb25d9f to your computer and use it in GitHub Desktop.
Gruntfile template (CoffeeScript) for Phaser development
# Reference: https://github.com/gamecook/phaser-project-template
module.exports = (grunt) ->
# Package
# =======
pkg = require './package.json'
# Configuration
# =============
grunt.initConfig
pkg: pkg
# connect
# --------------------
connect:
server:
options:
port: 8080
base: './public'
# concat
# --------------------
concat:
dist:
src: [
"src/lib/**/*.js"
"src/game/**/*.js"
]
dest: 'public/js/<%= pkg.name %>.js'
# Watch
# --------------------
watch:
files: 'src/**/*.js'
tasks: ['concat']
# open
# --------------------
open:
dev:
path: 'http://localhost:8080/index.html'
# Dependencies
# ============
for name of pkg.devDependencies when name.substring(0, 6) is 'grunt-'
grunt.loadNpmTasks name
# Tasks
# ============
# build
# -------
grunt.registerTask 'build', [
'concat',
'connect',
'open',
'watch'
]
# default
# -------
grunt.registerTask 'default', [
'build'
'watch'
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment