Skip to content

Instantly share code, notes, and snippets.

@ivanoats
Created February 28, 2014 14:17
Show Gist options
  • Save ivanoats/9271827 to your computer and use it in GitHub Desktop.
Save ivanoats/9271827 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
clean: ['dist'],
ejs: {
all: {
options: {
// site-wide vars here
},
src: ['**/*.ejs', '!node_modules/**/*', '!_*/**/*'],
dest: 'dist/',
expand: true,
ext: '.html',
},
},
copy: {
all: {
src: ['*.css', '*.html', 'images/**/*', 'img/**/*', '!Gruntfile.js'],
dest: 'dist/',
},
},
browserify: {
all: {
src: 'app.js',
dest: 'dist/app.js'
},
options: {
transform: ['debowerify']
}
},
connect: {
options: {
port: process.env.PORT || 3131,
base: 'dist/',
},
all: {},
},
watch: {
options: {
livereload: true
},
html: {
files: '<%= ejs.all.src %>',
tasks: ['ejs'],
},
js: {
files: '<%= browserify.all.src %>',
tasks: ['browserify'],
},
assets: {
files: ['assets/**/*', '*.css', '*.js', 'images/**/*', 'img/**/*', '!Gruntfile.js'],
tasks: ['copy'],
}
},
'gh-pages': {
options: {
base: 'dist/'
},
src: ['**/*']
}
});
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['clean', 'ejs', 'browserify', 'copy']);
grunt.registerTask('server', ['default', 'connect', 'watch']);
grunt.registerTask('deploy', ['default', 'gh-pages']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment