Skip to content

Instantly share code, notes, and snippets.

@dnlmzw
Created March 24, 2014 13:54
Show Gist options
  • Save dnlmzw/9740533 to your computer and use it in GitHub Desktop.
Save dnlmzw/9740533 to your computer and use it in GitHub Desktop.
module.exports = (grunt) ->
# Package
# =======
pkg = require './package.json'
folders =
src: 'mpg_src'
dev: 'mpg'
dist: 'mpg_dist'
grunt.event.on 'watch', (action, filepath) ->
console.log('Hello');
# Configuration
# =============
grunt.initConfig
# Package
# -------
pkg: pkg
# Clean
# -----
clean:
dev: folders.dev
# Copy
# ------
copy:
dev:
cwd: folders.src
expand: true
src: '**/*'
dest: folders.dev
# Watching for changes
# --------------------
watch:
dev:
files: 'mpg_src/**/*'
tasks: ['copy:dev']
options:
reload: true
interrupt: true
spawn: false
# # Compilation
# # -----------
# coffee:
# compile:
# files: [
# expand: true
# dest: 'temp/'
# cwd: 'src'
# src: '**/*.coffee'
# ext: '.js'
# ]
# Module concatenation
# --------------------
# TODO: Remove this when uRequire hits 0.3
# concat:
# universal:
# files: [
# dest: 'build/<%= pkg.name %>.js'
# src: modules
# ]
# Minify
# ------
# uglify:
# universal:
# files:
# 'build/chaplin.min.js': 'build/chaplin.js'
# Compression
# -----------
# compress:
# files: [
# src: 'build/chaplin.min.js'
# dest: 'build/chaplin.min.js.gz'
# ]
# Config
# ============
# On watch events, inject only the changed files into the config
#grunt.config(['jshint', 'all', 'src'], [filepath]);
# Dependencies
# ============
for name of pkg.devDependencies when name.substring(0, 6) is 'grunt-'
grunt.loadNpmTasks name
# Tasks
# =====
# Prepare
# -------
# grunt.registerTask 'prepare', [
# 'clean'
# 'bower'
# 'clean:components'
# ]
# Build
# -----
# grunt.registerTask 'build', [
# 'coffee:compile'
# 'copy:universal'
# 'concat:universal'
# 'uglify'
# ]
# Lint
# ----
# grunt.registerTask 'lint', 'coffeelint'
# Default
# -------
grunt.registerTask 'default', ['clean:dev', 'copy:dev']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment