@@ -111,6 +111,13 @@ function Builder_1_11_0( build, jqueryUi, components, options, callback ) {
111111 build . files = files ;
112112 build . pkg = jqueryUi . pkg ;
113113
114+ build . commonFiles = files . commonFiles ;
115+ build . componentFiles = files . componentFiles . filter ( selected ) ;
116+
117+ build . componentMinFiles = build . componentFiles . filter ( function ( file ) {
118+ return ( / ^ u i \/ / ) . test ( file . path ) ;
119+ } ) . map ( min ) ;
120+
114121 // Bundle CSS (and minified)
115122 existingCss = function ( component ) {
116123 return files . get ( "themes/base/" + component + ".css" ) !== undefined ;
@@ -167,9 +174,49 @@ function Builder_1_11_0( build, jqueryUi, components, options, callback ) {
167174 } ) ;
168175 } ;
169176
177+ // Test files
178+ build . testFiles = files . testFiles ;
179+
170180 // Ad hoc
171181 build . jqueryCore = files . jqueryCore ;
172182
183+ // I18n files
184+ function i18nFiles ( callback ) {
185+ if ( components . indexOf ( "datepicker" ) >= 0 ) {
186+ build . i18nFiles = files . i18nFiles ;
187+ build . i18nMinFiles = files . i18nFiles . map ( min ) ;
188+ async . series ( [
189+ function ( callback ) {
190+ rjs ( rjsConfig ( {
191+ files : files ,
192+ intro : bundleI18nIntro ,
193+ include : files . i18nFiles . rename ( / u i \/ / , "" ) . rename ( / \. j s $ / , "" ) . paths ( ) ,
194+ exclude : [ "jquery" , "core" , "datepicker" ]
195+ } ) , function ( error , data ) {
196+ if ( error ) {
197+ return callback ( error ) ;
198+ }
199+ build . bundleI18n = Files ( {
200+ path : "jquery-ui-i18n.js" ,
201+ data : banner ( jqueryUi . pkg , files . i18nFiles . paths ( ) . map ( path . basename ) ) + data
202+ } ) ;
203+ callback ( ) ;
204+ } ) ;
205+ } ,
206+ function ( callback ) {
207+ build . bundleI18nMin = Files ( {
208+ path : "jquery-ui-i18n.min.js" ,
209+ data : banner ( jqueryUi . pkg , files . i18nFiles . paths ( ) . map ( path . basename ) , { minify : true } ) + stripBanner ( files . min ( build . bundleI18n [ 0 ] ) )
210+ } ) ;
211+ callback ( ) ;
212+ }
213+ ] , callback ) ;
214+ } else {
215+ build . i18nFiles = build . i18nMinFiles = build . bundleI18n = build . bundleI18nMin = Files ( ) ;
216+ callback ( ) ;
217+ }
218+ }
219+
173220 // Bundle JS (and minified)
174221 function bundleJs ( callback ) {
175222 var jsComponentFileNames = components . map ( function ( component ) {
@@ -204,6 +251,7 @@ function Builder_1_11_0( build, jqueryUi, components, options, callback ) {
204251 }
205252
206253 async . series ( [
254+ i18nFiles ,
207255 bundleJs
208256 ] , function ( error ) {
209257 callback ( error , build ) ;
0 commit comments