Skip to content

Instantly share code, notes, and snippets.

@thanpolas
Last active December 26, 2015 16:48
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thanpolas/7182266 to your computer and use it in GitHub Desktop.
Save thanpolas/7182266 to your computer and use it in GitHub Desktop.
Grunt Config for node server + livereload
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
express: {
options: {
// Override defaults here
},
web: {
options: {
script: 'backend/app.js',
}
},
},
watch: {
frontend: {
options: {
livereload: true
},
files: [
// triggering livereload when the .css file is updated
// (compared to triggering when sass completes)
// allows livereload to not do a full page refresh
'frontend/static/styles/*.css',
'frontend/templates/**/*.jade',
'frontend/static/scripts/**/*.js',
'frontend/static/img/**/*'
]
},
stylesSass: {
files: [
'!frontend/styles/sass-twitter-bootstrap/',
'frontend/styles/**/*.scss'
],
tasks: [
'compass'
]
},
web: {
files: [
'backend/**/*.js',
'config/*',
'test/**/*.js',
],
tasks: [
'express:web'
],
options: {
nospawn: true, //Without this option specified express won't be reloaded
atBegin: true,
}
}
},
parallel: {
web: {
options: {
stream: true
},
tasks: [{
grunt: true,
args: ['watch:frontend']
}, {
grunt: true,
args: ['watch:stylesSass']
}, {
grunt: true,
args: ['watch:web']
}]
},
}
});
grunt.registerTask('web', 'launch webserver and watch tasks', [
'parallel:web',
]);
grunt.registerTask('default', ['web']);
};
@stephenwil
Copy link

Is the 'start' task being registered an error? Don't see it being defined anywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment