1 module.exports = function(grunt) {
3 // Project configuration.
6 pkg: grunt.file.readJSON('package.json'),
8 '* <%= pkg.name %>.js v<%= pkg.version %> by @fat and @mdo\n' +
9 '* Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
10 '* <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
12 jqueryCheck: 'if (!jQuery) { throw new Error(\"Bootstrap requires jQuery\") }\n\n',
13 // Task configuration.
19 banner: '<%= banner %><%= jqueryCheck %>',
23 src: ['js/transition.js', 'js/alert.js', 'js/button.js', 'js/carousel.js', 'js/collapse.js', 'js/dropdown.js', 'js/modal.js', 'js/tooltip.js', 'js/popover.js', 'js/scrollspy.js', 'js/tab.js', 'js/affix.js'],
24 dest: 'dist/js/<%= pkg.name %>.js'
29 jshintrc: 'js/.jshintrc'
38 src: ['js/tests/unit/*.js']
47 'dist/css/bootstrap.css': ['less/bootstrap.less']
55 'dist/css/bootstrap.min.css': ['less/bootstrap.less']
61 banner: '<%= banner %>'
65 'dist/js/<%= pkg.name %>.min.js': ['<%= concat.bootstrap.dest %>']
71 inject: 'js/tests/unit/phantom.js'
73 files: ['js/tests/*.html']
85 files: '<%= jshint.src.src %>',
86 tasks: ['jshint:src', 'qunit']
89 files: '<%= jshint.test.src %>',
90 tasks: ['jshint:test', 'qunit']
100 // These plugins provide necessary tasks.
101 grunt.loadNpmTasks('grunt-contrib-connect');
102 grunt.loadNpmTasks('grunt-contrib-clean');
103 grunt.loadNpmTasks('grunt-contrib-concat');
104 grunt.loadNpmTasks('grunt-contrib-jshint');
105 grunt.loadNpmTasks('grunt-contrib-uglify');
106 grunt.loadNpmTasks('grunt-contrib-qunit');
107 grunt.loadNpmTasks('grunt-contrib-watch');
108 grunt.loadNpmTasks('grunt-recess');
112 grunt.registerTask('test', ['jshint', 'qunit']);
114 // JS distribution task.
115 grunt.registerTask('dist-js', ['concat', 'uglify']);
117 // CSS distribution task.
118 grunt.registerTask('dist-css', ['recess']);
120 // Full distribution task.
121 grunt.registerTask('dist', ['clean', 'dist-css', 'dist-js']);
124 grunt.registerTask('default', ['test', 'dist']);