Created
November 18, 2012 23:35
-
-
Save jonschlinkert/4108159 to your computer and use it in GitHub Desktop.
grunt-reload-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
<html> | |
<head> | |
<title>For testing javascript</title> | |
<script src="console.js"></script> | |
</head> | |
<body> | |
<p>Run grunt, then open this file at the localhost/server initialized by the gruntfile. You should now see real-time, live updates whenever you edit and save either the HTML or js file.</p> | |
</body> | |
</html> |
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
// test code here |
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
lint:{ | |
files:['console.js'] | |
}, | |
// Reload browswer when files change | |
reload: { | |
proxy: {} | |
}, | |
server: { | |
port: 8000 | |
}, | |
trigger: { | |
watchFile: 'console.js' | |
}, | |
// Watch and reload files in the browser | |
watch:{ | |
console: { | |
files: ['console.html','console.js'], | |
tasks: 'reload' | |
}, | |
test: { | |
files: ['console.html','console.js'], | |
tasks: 'reload trigger' | |
} | |
} | |
}); | |
// Register npm tasks | |
grunt.loadNpmTasks('grunt-reload'); | |
// Default task. | |
grunt.registerTask('default', 'server reload watch:console'); | |
}; |
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": "grunt-reload-boilerplate", | |
"description": "Simple boilerplate for initializing html/css/js projects that require live browser reloading.", | |
"version": "0.1.0", | |
"homepage": "https://github.com/jonschlinkert/grunt-reload-boilerplate", | |
"author": { | |
"name": "Jon Schlinkert", | |
"email": "github@sellside.com" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/jonschlinkert/grunt-reload-boilerplate.git" | |
}, | |
"bugs": { | |
"url": "https://github.com/jonschlinkert/grunt-reload-boilerplate/issues" | |
}, | |
"licenses": [ | |
{ | |
"type": "MIT", | |
"url": "https://github.com/jonschlinkert/grunt-reload-boilerplate/blob/master/LICENSE-MIT" | |
} | |
], | |
"main": "lib/grunt-reload-boilerplate", | |
"engines": { | |
"node": ">= 0.6.0" | |
}, | |
"scripts": { | |
"test": "grunt test" | |
}, | |
"devDependencies": { | |
"grunt": "~0.3.17" | |
}, | |
"keywords": [] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment