@@ -43,16 +43,17 @@ gulp.task('build:cross', ['backend:prod:cross', 'build-frontend:cross']);
43
43
/**
44
44
* Builds production version of the frontend application for the current architecture.
45
45
*/
46
- gulp . task ( 'build-frontend' , [ 'assets' , 'index:prod' , 'clean-dist' ] , function ( ) {
46
+ gulp . task ( 'build-frontend' , [ 'fonts' , 'icons' , ' assets', 'index:prod' , 'clean-dist' ] , function ( ) {
47
47
return buildFrontend ( conf . paths . distPublic ) ;
48
48
} ) ;
49
49
50
50
/**
51
51
* Builds production version of the frontend application for all architecures.
52
52
*/
53
- gulp . task ( 'build-frontend:cross' , [ 'assets:cross' , 'index:prod' , 'clean-dist' ] , function ( ) {
54
- return buildFrontend ( conf . paths . distPublicCross ) ;
55
- } ) ;
53
+ gulp . task (
54
+ 'build-frontend:cross' ,
55
+ [ 'fonts:cross' , 'icons:cross' , 'assets:cross' , 'index:prod' , 'clean-dist' ] ,
56
+ function ( ) { return buildFrontend ( conf . paths . distPublicCross ) ; } ) ;
56
57
57
58
/**
58
59
* Copies assets to the dist directory for current architecture.
@@ -65,6 +66,28 @@ gulp.task('assets', ['clean-dist'], function() { return assets([conf.paths.distP
65
66
gulp . task (
66
67
'assets:cross' , [ 'clean-dist' ] , function ( ) { return assets ( conf . paths . distPublicCross ) ; } ) ;
67
68
69
+ /**
70
+ * Copies icons to the dist directory for current architecture.
71
+ */
72
+ gulp . task ( 'icons' , [ 'clean-dist' ] , function ( ) { return icons ( conf . paths . iconsDistPublic ) ; } ) ;
73
+
74
+ /**
75
+ * Copies icons to the dist directory for all architectures.
76
+ */
77
+ gulp . task (
78
+ 'icons:cross' , [ 'clean-dist' ] , function ( ) { return icons ( conf . paths . iconsDistPublicCross ) ; } ) ;
79
+
80
+ /**
81
+ * Copies fonts to the dist directory for current architecture.
82
+ */
83
+ gulp . task ( 'fonts' , [ 'clean-dist' ] , function ( ) { return fonts ( conf . paths . fontsDistPublic ) ; } ) ;
84
+
85
+ /**
86
+ * Copies fonts to the dist directory for all architectures.
87
+ */
88
+ gulp . task (
89
+ 'fonts:cross' , [ 'clean-dist' ] , function ( ) { return fonts ( conf . paths . fontsDistPublicCross ) ; } ) ;
90
+
68
91
/**
69
92
* Cleans all build artifacts.
70
93
*/
@@ -131,3 +154,27 @@ function assets(outputDirs) {
131
154
return gulp . src ( path . join ( conf . paths . assets , '/**/*' ) , { base : conf . paths . app } )
132
155
. pipe ( multiDest ( outputDirs ) ) ;
133
156
}
157
+
158
+ /**
159
+ * @param {string|!Array<string> } outputDirs
160
+ * @return {stream }
161
+ */
162
+ function icons ( outputDirs ) {
163
+ let iconAssetsFilter = gulpFilter ( [ '*.woff2' , '*.woff' , '*.eot' , '*.ttf' ] ) ;
164
+
165
+ return gulp . src ( path . join ( conf . paths . materialIcons , '*' ) , { base : conf . paths . materialIcons } )
166
+ . pipe ( iconAssetsFilter )
167
+ . pipe ( multiDest ( outputDirs ) ) ;
168
+ }
169
+
170
+ /**
171
+ * @param {string|!Array<string> } outputDirs
172
+ * @return {stream }
173
+ */
174
+ function fonts ( outputDirs ) {
175
+ let fontFilter = gulpFilter ( [ '*.woff2' ] ) ;
176
+
177
+ return gulp . src ( path . join ( conf . paths . robotoFonts , '*' ) , { base : conf . paths . robotoFonts } )
178
+ . pipe ( fontFilter )
179
+ . pipe ( multiDest ( outputDirs ) ) ;
180
+ }
0 commit comments