Skip to content

Commit

Permalink
fix: corrected export path removing dist folder (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroedin authored Aug 20, 2024
1 parent ee3e137 commit b098f96
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-news-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/icons": patch
---

Corrected icon export path from `./dist/{{set}}/*` to `./{{set}}/*`
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ dist
_site
.DS_Store

.wireit
.wireit

# icon folders
microns
standard
social
ui
6 changes: 3 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const getContent = content =>

for (const path of await globby('src/**/*.svg')) {
const [filename, category] = path.split(sep).reverse();
await mkdir(new URL(`dist/${category}`, import.meta.url), { recursive: true });
await mkdir(new URL(`${category}`, import.meta.url), { recursive: true });
const svg = await readFile(new URL(path, import.meta.url), 'utf8');
await writeFile(new URL(`dist/${category}/${filename}`, import.meta.url), getSVG(svg), 'utf8');
await writeFile(new URL(`${category}/${filename}`, import.meta.url), getSVG(svg), 'utf8');
await writeFile(
new URL(`dist/${category}/${filename.replace(/\.svg$/, '.js')}`, import.meta.url),
new URL(`${category}/${filename.replace(/\.svg$/, '.js')}`, import.meta.url),
getContent(svg),
'utf8'
);
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
"test": "echo \"no tests yet\""
},
"files": [
"./dist/**/*.js",
"./dist/**/*.svg",
"./microns/**/*",
"./standard/**/*",
"./social/**/*",
"./ui/**/*",
"!scripts"
],
"repository": {
Expand Down

0 comments on commit b098f96

Please sign in to comment.