Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
feat(grunt): new 'serve' task
Browse files Browse the repository at this point in the history
- add livereload on the builded gh-page
- fix the existing watch task
  • Loading branch information
douglasduteil committed Dec 29, 2013
1 parent bd31923 commit a18ed32
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
37 changes: 32 additions & 5 deletions gruntFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (grunt) {

// Default task.
grunt.registerTask('default', ['jshint', 'karma:unit']);
grunt.registerTask('server', ['karma:start']);
grunt.registerTask('serve', [ 'karma:continuous', 'dist', 'build:gh-pages', 'connect:continuous', 'watch']);
grunt.registerTask('dist', ['concat:tmp', 'concat:modules', 'clean:rm_tmp', 'ngmin', 'uglify', 'concat:html_doc', 'copy']);

// HACK TO ACCESS TO THE COMPONENT-PUBLISHER
Expand Down Expand Up @@ -66,16 +66,43 @@ module.exports = function (grunt) {
' */',
''].join('\n')
},

watch: {
karma: {
files: ['modules/**/*.js'],
tasks: ['karma:unit:run'] //NOTE the :run flag

src: {
files: ['modules/**/*.js', '!modules/**/test/*Spec.js', 'demo/**/*.js'],
tasks: ['jshint:src', 'karma:unit:run', 'dist', 'build:gh-pages']
},
test: {
files: ['modules/**/test/*Spec.js'],
tasks: ['jshint:test', 'karma:unit:run']
},
demo: {
files: ['modules/**/demo/*'],
tasks: ['jshint:src', 'concat:html_doc', 'copy', 'build:gh-pages']
},
livereload: {
files: ['out/built/gh-pages/**/*'],
options: { livereload: true }
}
},

connect: {
options: {
base : 'out/built/gh-pages',
open: true,
livereload: true
},
server: { options: { keepalive: true } },
continuous: { options: { keepalive: false } }
},

karma: {
unit: testConfig('test/karma.conf.js'),
start: {configFile: 'test/karma.conf.js'}
server: {configFile: 'test/karma.conf.js'},
continuous: {configFile: 'test/karma.conf.js', background: true }
},

concat: {
html_doc: {
options: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-jshint": "~0.5.4",
"grunt-contrib-uglify": "~0.2.1",
Expand Down

0 comments on commit a18ed32

Please sign in to comment.