1 |
|
2 | module.exports = function(grunt) {
|
3 |
|
4 |
|
5 | grunt.initConfig({
|
6 | pkg: grunt.file.readJSON('package.json'),
|
7 | banner: '/** \n' +
|
8 | ' * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
|
9 | '<%= grunt.template.today("yyyy-mm-dd") %> \n' +
|
10 | ' * web: <%= pkg.homepage %> \n' +
|
11 | ' * issues: <%= pkg.bugs.url %> \n' +
|
12 | ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
|
13 | ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> \n */\n',
|
14 | concat: {
|
15 | dist: {
|
16 | src: ['libs/jquery.onfontresize.min.js', 'dist/placeholder_polyfill.jquery.min.js'],
|
17 | dest: 'dist/placeholder_polyfill.jquery.min.combo.js'
|
18 | }
|
19 | },
|
20 | jshint: {
|
21 | options: {
|
22 | curly: true,
|
23 | eqeqeq: true,
|
24 | immed: true,
|
25 | latedef: true,
|
26 | newcap: true,
|
27 | noarg: true,
|
28 | sub: true,
|
29 | undef: true,
|
30 | unused: true,
|
31 | boss: true,
|
32 | eqnull: true,
|
33 | browser: true,
|
34 | globals: {
|
35 | jQuery: true,
|
36 | requestAnimationFrame: true,
|
37 | cancelAnimationFrame: true
|
38 | }
|
39 | },
|
40 | files: ['Gruntfile.js', 'src/*.js']
|
41 | },
|
42 | uglify: {
|
43 | options: {
|
44 | banner: '<%= banner %>'
|
45 | },
|
46 | dist: {
|
47 | src: 'src/placeholder_polyfill.jquery.js',
|
48 | dest: 'dist/placeholder_polyfill.jquery.min.js'
|
49 | }
|
50 | },
|
51 | cssmin: {
|
52 | compress: {
|
53 | options: {
|
54 | banner: '<%= banner %>'
|
55 | },
|
56 | files: {
|
57 | 'dist/placeholder_polyfill.min.css': ['src/placeholder_polyfill.css']
|
58 | }
|
59 | }
|
60 | },
|
61 | markdown: {
|
62 | all: {
|
63 | files: [
|
64 | {
|
65 | expand: true,
|
66 | src: '*.markdown',
|
67 | dest: 'web/',
|
68 | ext: '.html'
|
69 | }
|
70 | ]
|
71 | }
|
72 | },
|
73 | bump: {
|
74 | options: {
|
75 | files: ['package.json', 'component.json', 'bower.json'],
|
76 | push: false
|
77 | }
|
78 | },
|
79 | watch: {
|
80 | gruntfile: {
|
81 | files: '<%= jshint.files %>',
|
82 | tasks: ['jshint']
|
83 | }
|
84 | }
|
85 | });
|
86 |
|
87 |
|
88 | grunt.registerTask('default', ['jshint', 'uglify', 'cssmin', 'concat', 'markdown']);
|
89 |
|
90 | grunt.loadNpmTasks('grunt-contrib-concat');
|
91 | grunt.loadNpmTasks('grunt-contrib-uglify');
|
92 | grunt.loadNpmTasks('grunt-contrib-cssmin');
|
93 | grunt.loadNpmTasks('grunt-contrib-jshint');
|
94 | grunt.loadNpmTasks('grunt-contrib-watch');
|
95 | grunt.loadNpmTasks('grunt-markdown');
|
96 | grunt.loadNpmTasks('grunt-bump');
|
97 |
|
98 | };
|