|
1 | 1 | module.exports = function(grunt) { |
2 | 2 |
|
| 3 | + var banner = '/**\n @name: <%= pkg.name %> \n @version: <%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) \n @author: <%= pkg.author %> \n @url: <%= pkg.homepage %> \n @license: <%= pkg.license %>\n*/\n'; |
| 4 | + |
| 5 | + var files = [ |
| 6 | + 'src/aping-github-directive.js', |
| 7 | + 'src/aping-github-helper.js', |
| 8 | + 'node_modules/angular-github-api-factory/src/angular-github-api-factory.js' |
| 9 | + ]; |
| 10 | + |
3 | 11 | grunt.initConfig({ |
4 | 12 | pkg: grunt.file.readJSON('package.json'), |
5 | 13 | uglify: { |
6 | 14 | js: { |
7 | 15 | files : { |
8 | | - 'dist/aping-plugin-github.min.js' : [ |
9 | | - 'src/aping-github-directive.js', |
10 | | - 'src/aping-github-helper.js', |
11 | | - 'bower_components/angular-github-api-factory/src/angular-github-api-factory.js' |
12 | | - ] |
| 16 | + 'dist/aping-plugin-github.min.js' : files |
13 | 17 | } |
14 | 18 | }, |
15 | 19 | options: { |
16 | | - banner: '\n/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) by <%= pkg.author %> */\n', |
| 20 | + banner: banner, |
17 | 21 | } |
18 | 22 | }, |
| 23 | + concat: { |
| 24 | + options: { |
| 25 | + separator: ';', |
| 26 | + banner: banner, |
| 27 | + }, |
| 28 | + dist: { |
| 29 | + files : { |
| 30 | + 'dist/aping-plugin-github.js' : files |
| 31 | + } |
| 32 | + }, |
| 33 | + }, |
19 | 34 | watch: { |
20 | 35 | minifiyJs: { |
21 | | - files: [ |
22 | | - 'src/aping-github-directive.js', |
23 | | - 'src/aping-github-helper.js', |
24 | | - 'bower_components/angular-github-api-factory/src/angular-github-api-factory.js' |
25 | | - ], |
26 | | - tasks: ['uglify'], |
| 36 | + files: files, |
| 37 | + tasks: ['uglify', 'concat'], |
27 | 38 | options: { |
28 | 39 | spawn: true, |
29 | 40 | } |
30 | 41 | } |
31 | 42 | } |
32 | 43 | }); |
33 | 44 |
|
| 45 | + grunt.loadNpmTasks('grunt-contrib-concat'); |
34 | 46 | grunt.loadNpmTasks('grunt-contrib-uglify'); |
35 | 47 | grunt.loadNpmTasks('grunt-contrib-watch'); |
36 | 48 |
|
|
0 commit comments