From e986485a6e31055980d3c5a279ea8dff84bb35e3 Mon Sep 17 00:00:00 2001 From: Tasos Bekos Date: Mon, 30 Dec 2013 16:01:02 +0100 Subject: [PATCH] chore(build): add banner into build files Closes #1493 --- Gruntfile.js | 19 ++++++++++++++----- misc/demo/index.html | 2 +- package.json | 4 +++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 49df257fa3..b140a35b63 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,7 +26,13 @@ module.exports = function(grunt) { meta: { modules: 'angular.module("ui.bootstrap", [<%= srcModules %>]);', tplmodules: 'angular.module("ui.bootstrap.tpls", [<%= tplModules %>]);', - all: 'angular.module("ui.bootstrap", ["ui.bootstrap.tpls", <%= srcModules %>]);' + all: 'angular.module("ui.bootstrap", ["ui.bootstrap.tpls", <%= srcModules %>]);', + banner: ['/*', + ' * <%= pkg.name %>', + ' * <%= pkg.homepage %>\n', + ' * Version: <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>', + ' * License: <%= pkg.license %>', + ' */\n'].join('\n') }, delta: { docs: { @@ -46,14 +52,14 @@ module.exports = function(grunt) { concat: { dist: { options: { - banner: '<%= meta.modules %>\n' + banner: '<%= meta.banner %><%= meta.modules %>\n' }, src: [], //src filled in by build task dest: '<%= dist %>/<%= filename %>-<%= pkg.version %>.js' }, dist_tpls: { options: { - banner: '<%= meta.all %>\n<%= meta.tplmodules %>\n' + banner: '<%= meta.banner %><%= meta.all %>\n<%= meta.tplmodules %>\n' }, src: [], //src filled in by build task dest: '<%= dist %>/<%= filename %>-tpls-<%= pkg.version %>.js' @@ -83,12 +89,15 @@ module.exports = function(grunt) { } }, uglify: { + options: { + banner: '<%= meta.banner %>' + }, dist:{ - src:['<%= dist %>/<%= filename %>-<%= pkg.version %>.js'], + src:['<%= concat.dist.dest %>'], dest:'<%= dist %>/<%= filename %>-<%= pkg.version %>.min.js' }, dist_tpls:{ - src:['<%= dist %>/<%= filename %>-tpls-<%= pkg.version %>.js'], + src:['<%= concat.dist_tpls.dest %>'], dest:'<%= dist %>/<%= filename %>-tpls-<%= pkg.version %>.min.js' } }, diff --git a/misc/demo/index.html b/misc/demo/index.html index feb7b87a79..4257334153 100644 --- a/misc/demo/index.html +++ b/misc/demo/index.html @@ -212,7 +212,7 @@

<%= module.displayName %> diff --git a/package.json b/package.json index 86ae0221b6..2daf709421 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "author": "https://github.com/angular-ui/bootstrap/graphs/contributors", "name": "angular-ui-bootstrap", "version": "0.10.0-SNAPSHOT", + "homepage": "http://angular-ui.github.io/bootstrap/", "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", @@ -17,5 +18,6 @@ "node-markdown": "0.1.1", "semver": "~1.1.4", "shelljs": "~0.1.4" - } + }, + "license": "MIT" }