Skip to content

Instantly share code, notes, and snippets.

@naru0504
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naru0504/e895bfc23a94947ac91c to your computer and use it in GitHub Desktop.
Save naru0504/e895bfc23a94947ac91c to your computer and use it in GitHub Desktop.
gruntfile.js for grunt-simple-frontend
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jade: {
app: {
options: {
pretty: true
},
files: [
{
expand: true,
cwd: 'app/jade/',
src: '**/*.jade',
dest: 'app/',
ext: '.html'
}
]
}
},
stylus: {
app: {
files: {
'app/dest/style.css': 'app/stylus/style.styl'
}
}
},
coffee: {
app:{
files:[
{
expand: true,
cwd: 'app/coffee/',
src: '**/*.coffee',
dest: 'app/dest/js/',
ext: '.js'
}
]
}
},
connect: {
server: {
options: {
port: 5040,
hostname: 'localhost',
open: true,
base: 'app'
}
}
},
watch: {
options: {
spawn: false,
livereload: true
},
jade: {
files:
[
'app/jade/**/*.jade'
],
tasks:
[
'jade'
]
},
stylus: {
files:
[
'app/stylus/style.styl'
],
tasks:
[
'stylus'
]
},
coffee: {
files:
[
'app/coffee/**/*.coffee'
],
tasks:
[
'coffee'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('htmltask',['jade']);
grunt.registerTask('csstask',['stylus']);
grunt.registerTask('jstask',['coffee']);
grunt.registerTask('compile',['htmltask','csstask','jstask']);
grunt.registerTask('default',['compile','connect','watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment