Skip to content

Instantly share code, notes, and snippets.

@ivanoats
Created February 28, 2014 14:18
Show Gist options
  • Save ivanoats/9271836 to your computer and use it in GitHub Desktop.
Save ivanoats/9271836 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']);
};
{
"name": "grunt-static-site-test",
"version": "0.0.0",
"description": "a test of the yeoman grunt static site test",
"scripts": {
"start": "grunt server",
"ghpages": "grunt ghpages"
},
"homepage": "http://github.com/ivanoats/grunt-static-site-test",
"bugs": "http://github.com/ivanoats/grunt-static-site-test/issues",
"author": {
"name": "Ivan Storck",
"email": "ivan@ivanstorck.com",
"url": "https://github.com/ivanoats"
},
"repository": {
"type": "git",
"url": "git://github.com/ivanoats/grunt-static-site-test.git"
},
"dependencies": {
},
"devDependencies": {
"grunt": "~0.4.1",
"matchdep": "~0.1.2",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.3.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-watch": "~0.4.4",
"grunt-browserify": "~1.2.0",
"grunt-gh-pages": "~0.6.0",
"grunt-ejs": "~0.1.0",
"debowerify": "~0.1.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment