Skip to content

Commit

Permalink
Chore(web): Do not deploy Offcanvas component as it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Nov 6, 2023
1 parent ef567b1 commit bd577b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions packages/web/scripts/prepareDist.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readdirSync } from 'fs';
import { resolve } from 'path';
import { readdirSync } from 'fs';

const getDirs = (source) =>
readdirSync(source, { withFileTypes: true })
Expand All @@ -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,
{},
);
2 changes: 1 addition & 1 deletion packages/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit bd577b0

Please sign in to comment.