Last active
August 29, 2015 14:03
-
-
Save waifung0207/e5c435380d37dfb25d9f to your computer and use it in GitHub Desktop.
Gruntfile template (CoffeeScript) for Phaser development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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