Last active
August 29, 2015 14:09
-
-
Save jschaf/0ede23031968bcc1e578 to your computer and use it in GitHub Desktop.
Gruntfile.js Watch Task doesn't produce output
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 = 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']); | |
}; |
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
<!doctype html> | |
<meta charset=utf-8> | |
<title>blah</title> | |
<p>I'm the content |
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
{ | |
"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