vista
Version:
Really easy, CSS-based, location-driven display control for your elements.
117 lines (110 loc) • 2.5 kB
JavaScript
'use strict';
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({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= pkg.licenses.type %> */\n',
// Task configuration.
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= banner %>',
process: true,
stripBanners: true
},
dist: {
src: ['src/<%= pkg.name %>.js'],
dest: 'dist/<%= pkg.name %>.js'
},
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
src: '<%= concat.dist.dest %>',
dest: 'dist/<%= pkg.name %>.min.js'
},
},
compress: {
options: {
mode: 'gzip'
},
dist: {
src: ['dist/<%= pkg.name %>.min.js'],
dest: 'dist/<%= pkg.name %>.min.js'
},
},
connect: {
test: {
options: {
base: '.',
port: 9000
}
}
},
qunit: {
options: {
timeout: 5000,
httpBase: 'http://localhost:9000'
},
src: ['test/*.html']
},
jshint: {
gruntfile: {
options: {
jshintrc: '.jshintrc'
},
src: 'Gruntfile.js'
},
src: {
options: {
jshintrc: 'src/.jshintrc'
},
src: ['src/**/*.js']
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/**/*.js']
},
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
src: {
files: '<%= jshint.src.src %>',
tasks: ['jshint:src', 'qunit']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'qunit']
},
},
});
grunt.loadTasks('tasks');
// Default task.
grunt.registerTask('default', [
'jshint',
'clean',
'concat',
'uglify',
'connect',
'qunit',
'compress'
]);
};