@@ -10,27 +10,38 @@ var rawList = allFiles.map(function(file) {
10
10
} ) ;
11
11
12
12
var minify = {
13
- 'dist/ui/minified/jquery-ui.min.js' : [ '<banner>' , 'dist/ui/jquery-ui.js' ] ,
13
+ 'dist/ui/minified/jquery-ui.min.js' : [ '<banner:meta.bannerAll >' , 'dist/ui/jquery-ui.js' ] ,
14
14
// TODO adjust banner to get access to the list of included files
15
- 'dist/ui/minified/i18n/jquery-ui-i18n.min.js' : [ '<banner>' , 'dist/ui/i18n/jquery-ui-i18n.js' ]
15
+ 'dist/ui/minified/i18n/jquery-ui-i18n.min.js' : [ '<banner:meta.bannerI18n >' , 'dist/ui/i18n/jquery-ui-i18n.js' ]
16
16
} ;
17
17
function minFile ( file ) {
18
18
// TODO adjust banner to get access to the list of included files
19
19
minify [ 'dist/' + file . replace ( / \. j s $ / , '.min.js' ) . replace ( / u i \/ / , 'ui/minified/' ) ] = [ '<banner>' , file ] ;
20
20
}
21
21
allFiles . forEach ( minFile ) ;
22
- file . expand ( 'ui/i18n/*.js' ) . forEach ( minFile ) ;
23
22
24
- config . init ( {
25
- pkg : '<json:package.json>' ,
26
- meta : {
27
- banner : '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
23
+ var allI18nFiles = file . expand ( 'ui/i18n/*.js' ) ;
24
+ allI18nFiles . forEach ( minFile ) ;
25
+ var i18nfiles = allI18nFiles . map ( function ( file ) {
26
+ return file . substring ( 8 ) ;
27
+ } ) ;
28
+
29
+ function createBanner ( files ) {
30
+ return '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
28
31
'<%= template.today("isoDate") %>\n' +
29
32
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
30
33
// TODO makes this banner only useful for the min-all task below...
31
- '* Includes: ' + rawList . join ( ', ' ) + '\n' +
34
+ ( files ? '* Includes: ' + files . join ( ', ' ) + '\n' : '' ) +
32
35
'* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' +
33
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
36
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' ;
37
+ }
38
+
39
+ config . init ( {
40
+ pkg : '<json:package.json>' ,
41
+ meta : {
42
+ banner : createBanner ( ) ,
43
+ bannerAll : createBanner ( rawList ) ,
44
+ bannerI18n : createBanner ( i18nfiles )
34
45
} ,
35
46
concat : {
36
47
'dist/ui/jquery-ui.js' : allFiles ,
0 commit comments