Skip to content

Instantly share code, notes, and snippets.

@jschaf
Last active August 29, 2015 14:09
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 jschaf/0ede23031968bcc1e578 to your computer and use it in GitHub Desktop.
Save jschaf/0ede23031968bcc1e578 to your computer and use it in GitHub Desktop.
Gruntfile.js Watch Task doesn't produce output
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
base: 'build',
port: 8000
}
}
},
copy: {
main: {
files: [
{src: 'index.html', dest: 'build/index.html'}
]
}
},
watch: {
copy: {
files: ['*.html'],
task: ['copy']
}
}
});
grunt.registerTask('default', ['copy', 'connect', 'watch']);
};
<!doctype html>
<meta charset=utf-8>
<title>blah</title>
<p>I'm the content
{
"name": "test",
"description": "test description",
"version": "0.1.0",
"repository": "fakerepo",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-copy": "^0.7.0",
"grunt-contrib-watch": "^0.6.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment