Created
April 1, 2015 06:18
-
-
Save firedev/3f8ebc53a9438ee36201 to your computer and use it in GitHub Desktop.
Gruntfile for setting up Slim, SASS and Coffeescript compilation to public folder
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
module.exports = (grunt) -> | |
# configuration | |
grunt.initConfig | |
# grunt sass | |
sass: | |
compile: | |
options: | |
style: 'expanded' | |
files: [ | |
expand: true | |
cwd: 'sass' | |
src: ['**/*.sass', '**/*.scss'] | |
dest: 'public/css' | |
ext: '.css' | |
] | |
# grunt coffee | |
coffee: | |
compile: | |
expand: true | |
cwd: 'coffee' | |
src: ['**/*.coffee'] | |
dest: 'public/js' | |
ext: '.js' | |
options: | |
bare: true | |
preserve_dirs: true | |
# grunt slim | |
slim: | |
dist: | |
options: | |
pretty: true | |
files: [{ | |
cwd: 'slim' | |
dest: 'public' | |
expand: true | |
src: ['**/*.slim'] | |
ext: '.html' | |
}] | |
# grunt watch (or simply grunt) | |
watch: | |
html: | |
files: ['**/*.html'] | |
sass: | |
files: ['**/*.sass'] | |
tasks: ['sass'] | |
coffee: | |
files: '<%= coffee.compile.src %>' | |
tasks: ['coffee'] | |
slim: | |
files: ['**/*.slim'] | |
tasks: ['slim'] | |
options: | |
livereload: true | |
# grunt connect | |
connect: | |
server: | |
options: | |
base: 'public' | |
open: true | |
# load plugins | |
grunt.loadNpmTasks 'grunt-contrib-sass' | |
grunt.loadNpmTasks 'grunt-contrib-coffee' | |
grunt.loadNpmTasks 'grunt-contrib-watch' | |
grunt.loadNpmTasks 'grunt-slim' | |
grunt.loadNpmTasks 'grunt-contrib-connect' | |
# tasks | |
grunt.registerTask 'default', ['sass', 'coffee', 'slim', 'connect', 'watch'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment