Skip to content

Instantly share code, notes, and snippets.

@yuchant
Created December 13, 2013 08:12
Show Gist options
  • Save yuchant/7941211 to your computer and use it in GitHub Desktop.
Save yuchant/7941211 to your computer and use it in GitHub Desktop.
module.exports = (grunt) ->
srcBase = "v2/frontend"
grunt.initConfig
# config:
paths:
phpBase: "public_html"
src: "public_html/v2/frontend"
dest: "public_html/v2/assets/build"
pkg: grunt.file.readJSON("package.json")
watch:
livereload:
files: [
"<%= paths.dest %>/**/*.css"
]
options:
livereload: 35740
js:
files: ["<%= paths.src %>/coffee/{,**}/*.coffee"]
tasks: ["coffee"]
sass:
files: ["<%= paths.src %>/sass/{,**}/*.{sass,scss}"]
tasks: ["compass"]
coffee:
compile:
options:
join: true
files: [
"<%= paths.dest %>/scripts/main.js": [
"<%= paths.src %>/coffee/common/*.coffee"
"<%= paths.src %>/coffee/global/*.coffee"
"<%= paths.src %>/coffee/modules/*.coffee"
"<%= paths.src %>/coffee/pages/*.coffee"
]
# {
# expand: true # Enable dynamic expansion.
# cwd: "<%= paths.src %>/coffee/pages/" # Src matches are relative to this path.
# src: ["*.coffee"] # Actual pattern(s) to match.
# dest: "<%= paths.dest %>/scripts/pages/" # Destination path prefix.
# ext: ".js" # Dest filepaths will have this extension.
# }
]
sass:
dist:
options:
style: 'expanded'
files:
"<%= paths.dest %>/styles/main.css": "<%= paths.src %>/sass/styles.scss"
compass:
dist:
options:
noLineComments: false
# debugInfo: true
sassDir: '<%= paths.src %>/sass'
cssDir: '<%= paths.dest %>/styles'
environment: 'development'
copy:
dist:
files: [
]
php:
dist:
options:
base: "<%= paths.phpBase %>"
port: 5000
keepalive: true
open: true
router: null
concurrent:
compile:
tasks: [
'coffee'
'compass'
]
server:
tasks: [
# 'php'
'watch'
]
options:
logConcurrentOutput: true
grunt.loadNpmTasks("grunt-contrib-coffee")
grunt.loadNpmTasks("grunt-contrib-watch")
grunt.loadNpmTasks("grunt-contrib-compass")
# grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-php')
grunt.loadNpmTasks("grunt-notify")
grunt.loadNpmTasks('grunt-concurrent')
grunt.registerTask "default", [
"concurrent:compile"
"concurrent:server"
# "watch"
# "php"
# "phpwatch"
]
# npm install --save-dev \
# grunt-contrib-coffee \
# grunt-contrib-watch \
# grunt-contrib-sass \
# grunt-contrib-copy \
# grunt-notify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment