Commit 1c9356a 1 parent ebfb30b commit 1c9356a Copy full SHA for 1c9356a
File tree 1 file changed +19
-5
lines changed
1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -218,30 +218,44 @@ function buildThemeConfig() {
218
218
)
219
219
) ;
220
220
221
+ console . log ( '*** buildThemeConfig' , {
222
+ __dirname,
223
+ __listFiles : fs . readdirSync ( __dirname , { encoding : 'utf8' } ) ,
224
+ themeGlob : path . join (
225
+ __dirname ,
226
+ 'node_modules' ,
227
+ '@elastic' ,
228
+ 'eui' ,
229
+ 'dist' ,
230
+ 'eui_theme_*.min.css'
231
+ ) ,
232
+ themeFiles,
233
+ } ) ;
234
+
221
235
const themeConfig = {
222
236
/** @type Array<{ id: string; name: string; publicPath: string; }> */
223
237
availableThemes : [ ] ,
224
238
/** @type Array<{ from: string; to: string; }> */
225
239
copyConfig : [ ] ,
226
240
} ;
227
241
228
- for ( const each of themeFiles ) {
229
- const basename = path . basename ( each , '.min.css' ) ;
242
+ for ( const themeFile of themeFiles ) {
243
+ const basename = path . basename ( themeFile , '.min.css' ) ;
230
244
231
245
const themeId = basename . replace ( / ^ e u i _ t h e m e _ / , '' ) ;
232
246
233
247
const themeName =
234
248
themeId [ 0 ] . toUpperCase ( ) + themeId . slice ( 1 ) . replace ( / _ / g, ' ' ) ;
235
249
236
- const publicPath = `themes/${ basename } .${ hashFile ( each ) } .min.css` ;
250
+ const publicPath = `themes/${ basename } .${ hashFile ( themeFile ) } .min.css` ;
237
251
238
252
const toPath = path . join (
239
253
__dirname ,
240
254
'electron' ,
241
255
'renderer' ,
242
256
`public` ,
243
257
`themes` ,
244
- `${ basename } .${ hashFile ( each ) } .min.css`
258
+ `${ basename } .${ hashFile ( themeFile ) } .min.css`
245
259
) ;
246
260
247
261
themeConfig . availableThemes . push ( {
@@ -251,7 +265,7 @@ function buildThemeConfig() {
251
265
} ) ;
252
266
253
267
themeConfig . copyConfig . push ( {
254
- from : each ,
268
+ from : themeFile ,
255
269
to : toPath ,
256
270
} ) ;
257
271
}
You can’t perform that action at this time.
0 commit comments