UNPKG

1.18 kBJavaScriptView Raw
1/*global module:false*/
2module.exports = function(grunt){
3
4
5 // Project configuration.
6 grunt.initConfig({
7 pkg: grunt.file.readJSON('package.json'),
8 bower: grunt.file.readJSON('bower.json'),
9 copy: {
10 demo: {
11 files: [
12 {expand: true, src: ['src/*'], dest: 'dist/', filter: 'isFile', flatten: true}
13 ]
14 }
15 },
16
17 uglify: {
18 options: {
19 beautify: {
20 ascii_only : true
21 },
22 preserveComments: 'some'
23 },
24 html5shiv: {
25 files: [{
26 expand: true, // Enable dynamic expansion.
27 cwd: 'src/', // Src matches are relative to this path.
28 src: ['**/*.js'], // Actual pattern(s) to match.
29 dest: 'dist/', // Destination path prefix.
30 ext: '.min.js'
31 }]
32 }
33 },
34 watch: {
35 js: {
36 files: ['src/**/*.js'],
37 tasks: ['copy', 'uglify', 'bytesize']
38 }
39 },
40 bytesize: {
41 all: {
42 src: [
43 'dist/**.min.js'
44 ]
45 }
46 }
47 });
48
49
50 // Default task.
51
52
53
54 grunt.loadNpmTasks('grunt-contrib-copy');
55 grunt.loadNpmTasks('grunt-contrib-uglify');
56 grunt.loadNpmTasks('grunt-contrib-watch');
57 grunt.loadNpmTasks('grunt-bytesize');
58
59 grunt.registerTask('default', ['copy', 'uglify', 'bytesize', 'watch']);
60
61};