Skip to content

Commit 1c9356a

Browse files
committed
chore(build): debug why breaks on windows
1 parent ebfb30b commit 1c9356a

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

next.config.js

+19-5
Original file line numberDiff line numberDiff line change
@@ -218,30 +218,44 @@ function buildThemeConfig() {
218218
)
219219
);
220220

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+
221235
const themeConfig = {
222236
/** @type Array<{ id: string; name: string; publicPath: string; }> */
223237
availableThemes: [],
224238
/** @type Array<{ from: string; to: string; }> */
225239
copyConfig: [],
226240
};
227241

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');
230244

231245
const themeId = basename.replace(/^eui_theme_/, '');
232246

233247
const themeName =
234248
themeId[0].toUpperCase() + themeId.slice(1).replace(/_/g, ' ');
235249

236-
const publicPath = `themes/${basename}.${hashFile(each)}.min.css`;
250+
const publicPath = `themes/${basename}.${hashFile(themeFile)}.min.css`;
237251

238252
const toPath = path.join(
239253
__dirname,
240254
'electron',
241255
'renderer',
242256
`public`,
243257
`themes`,
244-
`${basename}.${hashFile(each)}.min.css`
258+
`${basename}.${hashFile(themeFile)}.min.css`
245259
);
246260

247261
themeConfig.availableThemes.push({
@@ -251,7 +265,7 @@ function buildThemeConfig() {
251265
});
252266

253267
themeConfig.copyConfig.push({
254-
from: each,
268+
from: themeFile,
255269
to: toPath,
256270
});
257271
}

0 commit comments

Comments
 (0)