From 1c9356ae4c33b1fd7932fc02b5ca670d3136fc94 Mon Sep 17 00:00:00 2001 From: KatoakDR <68095633+KatoakDR@users.noreply.github.com> Date: Sun, 15 Oct 2023 20:03:58 -0500 Subject: [PATCH] chore(build): debug why breaks on windows --- next.config.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/next.config.js b/next.config.js index 624a5218..98f8ef4d 100644 --- a/next.config.js +++ b/next.config.js @@ -218,6 +218,20 @@ function buildThemeConfig() { ) ); + console.log('*** buildThemeConfig', { + __dirname, + __listFiles: fs.readdirSync(__dirname, { encoding: 'utf8' }), + themeGlob: path.join( + __dirname, + 'node_modules', + '@elastic', + 'eui', + 'dist', + 'eui_theme_*.min.css' + ), + themeFiles, + }); + const themeConfig = { /** @type Array<{ id: string; name: string; publicPath: string; }> */ availableThemes: [], @@ -225,15 +239,15 @@ function buildThemeConfig() { copyConfig: [], }; - for (const each of themeFiles) { - const basename = path.basename(each, '.min.css'); + for (const themeFile of themeFiles) { + const basename = path.basename(themeFile, '.min.css'); const themeId = basename.replace(/^eui_theme_/, ''); const themeName = themeId[0].toUpperCase() + themeId.slice(1).replace(/_/g, ' '); - const publicPath = `themes/${basename}.${hashFile(each)}.min.css`; + const publicPath = `themes/${basename}.${hashFile(themeFile)}.min.css`; const toPath = path.join( __dirname, @@ -241,7 +255,7 @@ function buildThemeConfig() { 'renderer', `public`, `themes`, - `${basename}.${hashFile(each)}.min.css` + `${basename}.${hashFile(themeFile)}.min.css` ); themeConfig.availableThemes.push({ @@ -251,7 +265,7 @@ function buildThemeConfig() { }); themeConfig.copyConfig.push({ - from: each, + from: themeFile, to: toPath, }); }