generator-landmark
Version:
A LandmarkJS Project Generator for Yeoman
122 lines (107 loc) • 2.01 kB
JavaScript
'use strict()';
var config= {
port: 3000
};
module.exports = function(grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
express: {
options: {
port: config.port
},
dev: {
options: {
script: 'landmark.js',
debug: true
}
}
},
jshint: {
options: {
reporter: require('jshint-stylish'),
force: true
},
all: [ 'routes/**/*.js',
'models/**/*.js'
],
server: [
'./landmark.js'
]
},
concurrent: {
dev: {
tasks: ['nodemon', 'node-inspector', 'watch'],
options: {
logConcurrentOutput: true
}
}
},
'node-inspector': {
custom: {
options: {
'web-host': 'localhost'
}
}
},
nodemon: {
debug: {
script: 'landmark.js',
options: {
nodeArgs: ['--debug'],
env: {
port: config.port
}
}
}
},
watch: {
js: {
files: [
'model/**/*.js',
'routes/**/*.js'
],
tasks: ['jshint:all']
},
express: {
files: [
'landmark.js',
'public/js/lib/**/*.{js,json}'
],
tasks: ['jshint:server', 'concurrent:dev']
},
livereload: {
files: [
'public/styles/**/*.css',
'public/styles/**/*.less',
'templates/**/*.jade',
'node_modules/landmark-serve/templates/**/*.jade'
],
options: {
livereload: true
}
}
}
});
// load jshint
grunt.registerTask('lint', function(target) {
grunt.task.run([
'jshint'
]);
});
// default option to connect server
grunt.registerTask('serve', function(target) {
grunt.task.run([
'jshint',
'concurrent:dev'
]);
});
grunt.registerTask('server', function () {
grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
grunt.task.run(['serve:' + target]);
});
};