2016-02-21 16:36:02 -06:00
|
|
|
'use strict';
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
|
2016-07-01 23:00:02 -05:00
|
|
|
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')
|
|
|
|
},
|
2016-07-01 23:00:02 -05:00
|
|
|
all: site.source + '/**/*.js',
|
2016-02-21 16:36:02 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
csslint: {
|
|
|
|
options: { csslintrc: '.csslintrc' },
|
|
|
|
check: {
|
2016-07-01 23:00:02 -05:00
|
|
|
src: site.source + '/**/*.css',
|
2016-02-21 16:36:02 -06:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
options: {
|
|
|
|
interrupt: true,
|
|
|
|
livereload: true,
|
|
|
|
livereloadOnError: false
|
|
|
|
},
|
|
|
|
js: {
|
2016-07-01 23:00:02 -05:00
|
|
|
files: site.source + '/**/*.js',
|
2016-02-21 16:36:02 -06:00
|
|
|
tasks: ['jshint:all']
|
|
|
|
},
|
|
|
|
css: {
|
2016-07-01 23:00:02 -05:00
|
|
|
files: site.source + '/**/*.css',
|
2016-02-21 16:36:02 -06:00
|
|
|
tasks: ['csslint:check']
|
|
|
|
},
|
|
|
|
html: {
|
2016-07-01 23:00:02 -05:00
|
|
|
files: site.source + '/**/*.html',
|
2016-02-21 16:36:02 -06:00
|
|
|
},
|
|
|
|
configFiles: {
|
|
|
|
files: [ 'Gruntfile.js' ],
|
|
|
|
options: { reload: true }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
connect: {
|
|
|
|
server: {
|
|
|
|
options: {
|
2016-07-01 23:00:02 -05:00
|
|
|
base: ['bower_components', site.source],
|
|
|
|
directory: site.source,
|
2016-02-21 16:36:02 -06:00
|
|
|
hostname: '*',
|
2016-07-01 23:00:02 -05:00
|
|
|
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']);
|
|
|
|
};
|