unignore bower_components
[bootswatch] / bower_components / bootstrap / Gruntfile.js
1 module.exports = function(grunt) {
2
3     // Project configuration.
4     grunt.initConfig({
5         // Metadata.
6         pkg: grunt.file.readJSON('package.json'),
7         banner: '/**\n' +
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' +
11                 '*/\n',
12         jqueryCheck: 'if (!jQuery) { throw new Error(\"Bootstrap requires jQuery\") }\n\n',
13         // Task configuration.
14         clean: {
15             dist: ['dist']
16         },
17         concat: {
18             options: {
19                 banner: '<%= banner %><%= jqueryCheck %>',
20                 stripBanners: false
21             },
22             bootstrap: {
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'
25             }
26         },
27         jshint: {
28             options: {
29                 jshintrc: 'js/.jshintrc'
30             },
31             gruntfile: {
32                 src: 'Gruntfile.js'
33             },
34             src: {
35                 src: ['js/*.js']
36             },
37             test: {
38                 src: ['js/tests/unit/*.js']
39             }
40         },
41         recess: {
42             options: {
43                 compile: true
44             },
45             bootstrap: {
46                 files: {
47                     'dist/css/bootstrap.css': ['less/bootstrap.less']
48                 }
49             },
50             min: {
51                 options: {
52                     compress: true
53                 },
54                 files: {
55                     'dist/css/bootstrap.min.css': ['less/bootstrap.less']
56                 }
57             }
58         },
59         uglify: {
60             options: {
61                 banner: '<%= banner %>'
62             },
63             bootstrap: {
64                 files: {
65                     'dist/js/<%= pkg.name %>.min.js': ['<%= concat.bootstrap.dest %>']
66                 }
67             }
68         },
69         qunit: {
70             options: {
71                 inject: 'js/tests/unit/phantom.js'
72             },
73             files: ['js/tests/*.html']
74         },
75         connect: {
76             server: {
77                 options: {
78                     port: 3000,
79                     base: '.'
80                 }
81             }
82         },
83         watch: {
84             src: {
85                 files: '<%= jshint.src.src %>',
86                 tasks: ['jshint:src', 'qunit']
87             },
88             test: {
89                 files: '<%= jshint.test.src %>',
90                 tasks: ['jshint:test', 'qunit']
91             },
92             recess: {
93                 files: 'less/*.less',
94                 tasks: ['recess']
95             }
96         }
97     });
98
99
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');
109
110
111     // Test task.
112     grunt.registerTask('test', ['jshint', 'qunit']);
113
114     // JS distribution task.
115     grunt.registerTask('dist-js', ['concat', 'uglify']);
116
117     // CSS distribution task.
118     grunt.registerTask('dist-css', ['recess']);
119
120     // Full distribution task.
121     grunt.registerTask('dist', ['clean', 'dist-css', 'dist-js']);
122
123     // Default task.
124     grunt.registerTask('default', ['test', 'dist']);
125 };