Skip to content

Commit

Permalink
Fix icon build script
Browse files Browse the repository at this point in the history
Use a dynamic import to only run the script if the icons are installed.
  • Loading branch information
t11r committed May 1, 2024
1 parent 6810bd4 commit d070a5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/create-icons.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import fs from 'fs';
import url from 'url';

import mdi from '@mdi/js';

const rootDir = url.fileURLToPath(new URL('..', import.meta.url));

if (!fs.existsSync(`${rootDir}/node_modules/@mdi/js`)) {
process.exit();
}

const mdi = await import('@mdi/js');

const iconsDir = `${rootDir}/src/components/icons`;

fs.mkdirSync(iconsDir, { recursive: true });
Expand Down

0 comments on commit d070a5a

Please sign in to comment.