@@ -63,6 +63,22 @@ const ALL_LOCALES = ['ar-XB', 'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en',
63
63
'ro' , 'ru' , 'sk' , 'sl' , 'sr' , 'sv' , 'th' , 'tr' , 'uk' , 'vi' , 'zh-CN' ,
64
64
'zh-TW' ] ;
65
65
66
+ // Default arguments to pass into Closure Compiler.
67
+ const COMPILER_DEFAULT_ARGS = {
68
+ compilation_level : OPTIMIZATION_LEVEL ,
69
+ language_out : 'ES5'
70
+ } ;
71
+
72
+ // The external dependencies needed by FirebaseUI.
73
+ const JS_DEPS = [
74
+ 'node_modules/material-design-lite/src/mdlComponentHandler.js' ,
75
+ 'node_modules/material-design-lite/src/button/button.js' ,
76
+ 'node_modules/material-design-lite/src/progress/progress.js' ,
77
+ 'node_modules/material-design-lite/src/spinner/spinner.js' ,
78
+ 'node_modules/material-design-lite/src/textfield/textfield.js' ,
79
+ 'node_modules/dialog-polyfill/dialog-polyfill.js'
80
+ ] ;
81
+
66
82
// Compiles the Closure templates into JavaScript.
67
83
gulp . task ( 'build-soy' , ( ) => new Promise ( ( resolve , reject ) => {
68
84
closureBuilder . build ( {
@@ -80,12 +96,6 @@ gulp.task('build-soy', () => new Promise((resolve, reject) => {
80
96
} , resolve ) ;
81
97
} ) ) ;
82
98
83
- // Default arguments to pass into Closure Compiler.
84
- const COMPILER_DEFAULT_ARGS = {
85
- compilation_level : OPTIMIZATION_LEVEL ,
86
- language_out : 'ES5'
87
- } ;
88
-
89
99
/**
90
100
* Invokes Closure Compiler.
91
101
* @param {!Array<string> } srcs The JS sources to compile.
@@ -186,16 +196,6 @@ function buildFirebaseUiJs(locale) {
186
196
repeatTaskForAllLocales ( 'build-firebaseui-js-$' , [ 'build-soy' ] ,
187
197
buildFirebaseUiJs ) ;
188
198
189
- // The external dependencies needed by FirebaseUI.
190
- const JS_DEPS = [
191
- 'node_modules/material-design-lite/src/mdlComponentHandler.js' ,
192
- 'node_modules/material-design-lite/src/button/button.js' ,
193
- 'node_modules/material-design-lite/src/progress/progress.js' ,
194
- 'node_modules/material-design-lite/src/spinner/spinner.js' ,
195
- 'node_modules/material-design-lite/src/textfield/textfield.js' ,
196
- 'node_modules/dialog-polyfill/dialog-polyfill.js'
197
- ] ;
198
-
199
199
/**
200
200
* Concatenates the core FirebaseUI JS with its external dependencies, and
201
201
* cleans up comments and whitespace in the dependencies.
@@ -234,15 +234,20 @@ function makeDefaultFile(fileName) {
234
234
}
235
235
}
236
236
237
+ // Builds the final JS file for all supported languages.
237
238
gulp . task ( 'build-all-js' , buildJsTasks , ( ) => makeDefaultFile ( 'firebaseui' ) ) ;
239
+
240
+ // Builds the final JS file for the default language.
238
241
gulp . task ( 'build-js' , [ 'build-js-' + DEFAULT_LOCALE ] ,
239
242
( ) => makeDefaultFile ( 'firebaseui' ) ) ;
240
243
241
- // Bundles the FirebaseUI JS with its dependencies as a NPM module.
244
+ // Bundles the FirebaseUI JS with its dependencies as a NPM module. This builds
245
+ // the NPM module for all languages.
242
246
repeatTaskForAllLocales (
243
247
'build-npm-$' , [ 'build-firebaseui-js-$' ] ,
244
248
( locale ) => concatWithDeps ( locale , 'npm' , NPM_MODULE_WRAPPER ) ) ;
245
249
250
+ // Builds the NPM module for the default language.
246
251
gulp . task ( 'build-npm' , [ 'build-npm-' + DEFAULT_LOCALE ] ,
247
252
( ) => makeDefaultFile ( 'npm' ) ) ;
248
253
@@ -271,8 +276,10 @@ function buildCss(isRtl) {
271
276
. pipe ( gulp . dest ( DEST_DIR ) ) ;
272
277
}
273
278
274
- // Concatenates and minifies the CSS sources.
279
+ // Concatenates and minifies the CSS sources for LTR languages .
275
280
gulp . task ( 'build-css' , ( ) => buildCss ( false ) ) ;
281
+
282
+ // Concatenates and minifies the CSS sources for RTL languages.
276
283
gulp . task ( 'build-css-rtl' , ( ) => buildCss ( true ) ) ;
277
284
278
285
// Creates a webserver that serves all files from the root of the package.
@@ -285,11 +292,11 @@ gulp.task('serve', () => {
285
292
// Deletes intermediate files.
286
293
gulp . task ( 'clean' , ( ) => fse . remove ( TMP_DIR ) ) ;
287
294
288
- // Executes the basic tasks.
295
+ // Executes the basic tasks for the default language .
289
296
gulp . task ( 'default' , [ 'build-js' , 'build-npm' , 'build-css' , 'build-css-rtl' ] ,
290
297
( ) => gulp . start ( 'clean' ) ) ;
291
298
292
- // Builds everything.
299
+ // Builds everything (JS for all languages, both LTR and RTL CSS) .
293
300
gulp . task ( 'build-all' ,
294
301
[ 'build-all-js' , 'build-npm' , 'build-css' , 'build-css-rtl' ] ,
295
302
( ) => gulp . start ( 'clean' ) ) ;
0 commit comments