Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Grunt Watch & Livereload #72

Merged
merged 4 commits into from

2 participants

@tomfuertes

Might want to double check the README and/or deprecate the node bin/serve section in favor of.

-Tom

@rmurphey rmurphey merged commit 9102e6c into from
@tomfuertes tomfuertes deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 29 additions and 3 deletions.
  1. +16 −0 Gruntfile.js
  2. +6 −0 README.md
  3. +5 −3 package.json
  4. +2 −0  tests/runner.html
View
16 Gruntfile.js
@@ -11,10 +11,26 @@ module.exports = function(grunt) {
options: {
jshintrc: '.jshintrc'
}
+ },
+ watch: {
+ scripts: {
+ files: 'app/**/*.js',
+ tasks: ['jshint'],
+ options: {
+ livereload: true
+ }
+ }
}
});
+ grunt.registerTask('server', 'Start a custom web server.', function() {
+ var server = require('./server/server.js');
+ server({ port : 4444, dev : true });
+ });
+
grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', [ 'jshint' ]);
+ grunt.registerTask('develop', [ 'server', 'watch' ]);
};
View
6 README.md
@@ -32,6 +32,12 @@ You can also run (most of) the tests on the command line:
The command line runner is a work in progress; contributions welcome :)
+You can also develop with live-reload and grunt-watch if that's your thing:
+
+ npm install -g grunt-cli
+ npm install
+ grunt develop
+
## I want to contribute tests; what do I do?
Submit a pull request! The tests are currently loosely organized by topic, so
View
8 package.json
@@ -16,12 +16,14 @@
"underscore" : "1.3.x",
"amdefine" : "0.0.2",
"expect.js" : "0.1.2",
- "grunt": "~0.4.0",
- "grunt-contrib-jshint": "~0.1.0"
+ "grunt" : "~0.4.0",
+ "grunt-contrib-jshint" : "~0.1.0"
},
"devDependencies": {
"mocha" : "1.2.x",
- "requirejs" : "1.0.x"
+ "requirejs" : "1.0.x",
+ "grunt-contrib-livereload" : "~0.1.2",
+ "grunt-contrib-watch" : "~0.4.4"
},
"scripts": {
"start": "node bin/serve",
View
2  tests/runner.html
@@ -20,5 +20,7 @@
</script>
<script src="/lib/require.js" data-main="app/config"></script>
+ <!-- livereload snippet -->
+ <script src="http://localhost:35729/livereload.js"></script>
</body>
</html>
Something went wrong with that request. Please try again.