From bd577b0a5dde01793885848aa6ac43352c68a640 Mon Sep 17 00:00:00 2001 From: literat Date: Mon, 6 Nov 2023 14:42:17 +0100 Subject: [PATCH] Chore(web): Do not deploy Offcanvas component as it is empty --- packages/web/scripts/prepareDist.js | 13 ++++++++----- packages/web/vite.config.ts | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/web/scripts/prepareDist.js b/packages/web/scripts/prepareDist.js index bcfb7430b0..12fbd48d07 100644 --- a/packages/web/scripts/prepareDist.js +++ b/packages/web/scripts/prepareDist.js @@ -1,5 +1,5 @@ +import { existsSync, readdirSync } from 'fs'; import { resolve } from 'path'; -import { readdirSync } from 'fs'; const getDirs = (source) => readdirSync(source, { withFileTypes: true }) @@ -8,9 +8,12 @@ const getDirs = (source) => export const getNestedDirs = (baseDir, mainFile) => getDirs(resolve(__dirname, `../${baseDir}`)).reduce( - (accumulator, dirName) => ({ - ...accumulator, - [dirName]: resolve(__dirname, `../${baseDir}/${dirName}/${mainFile}`), - }), + (accumulator, dirName) => + existsSync(resolve(__dirname, `../${baseDir}/${dirName}/${mainFile}`)) + ? { + ...accumulator, + [dirName]: resolve(__dirname, `../${baseDir}/${dirName}/${mainFile}`), + } + : accumulator, {}, ); diff --git a/packages/web/vite.config.ts b/packages/web/vite.config.ts index f20b349996..6c191fe282 100644 --- a/packages/web/vite.config.ts +++ b/packages/web/vite.config.ts @@ -2,7 +2,7 @@ import { resolve } from 'path'; import { defineConfig } from 'vite'; import handlebars from 'vite-plugin-handlebars'; import { getNestedDirs } from './scripts/prepareDist'; -import { getListOfNestedDirectories, getListOfIcons } from './scripts/utils'; +import { getListOfIcons, getListOfNestedDirectories } from './scripts/utils'; export default defineConfig({ plugins: [