js-scaffold/Gruntfile.js

80 lines
1.5 KiB
JavaScript
Raw Normal View History

2016-02-21 16:36:02 -06:00
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
var site = {
source: 'src',
dest: 'dist',
temp: '.tmp',
};
2016-02-21 16:36:02 -06:00
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: site.source + '/**/*.js',
2016-02-21 16:36:02 -06:00
},
csslint: {
options: { csslintrc: '.csslintrc' },
check: {
src: site.source + '/**/*.css',
2016-02-21 16:36:02 -06:00
}
},
watch: {
options: {
interrupt: true,
livereload: true,
2016-09-01 20:43:55 -05:00
livereloadOnError: true
2016-02-21 16:36:02 -06:00
},
js: {
files: site.source + '/**/*.js',
2016-02-21 16:36:02 -06:00
tasks: ['jshint:all']
},
css: {
files: site.source + '/**/*.css',
2016-02-21 16:36:02 -06:00
tasks: ['csslint:check']
},
html: {
files: site.source + '/**/*.html',
2016-02-21 16:36:02 -06:00
},
configFiles: {
files: [ 'Gruntfile.js' ],
options: { reload: true }
}
},
connect: {
server: {
options: {
base: ['bower_components', site.source],
directory: site.source,
2016-02-21 16:36:02 -06:00
hostname: '*',
livereload: true,
open: {
appName: 'open',
target: 'http://localhost:3000',
},
port: 3000,
2016-02-21 16:36:02 -06:00
}
}
}
});
// Tasks
grunt.registerTask('serve', function () {
grunt.task.run([
'jshint:all',
'csslint:check',
'connect',
'watch'
]);
});
grunt.registerTask('default', ['serve']);
};