Skip to content

Commit 77ae35f

Browse files
authoredMar 26, 2024··

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎.changeset/tricky-snakes-appear.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'style-dictionary': patch
3+
---
4+
5+
Fix scenario of passing absolute paths in Node env, do not remove leading slash in absolute paths.

‎lib/utils/combineJSON.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ export default async function combineJSON(
7272
files = files.concat(new_files);
7373
}
7474

75-
// adjust for browser env glob results have leading slash
76-
files = files.map((f) => f.replace(/^\//, ''));
75+
if (typeof window === 'object') {
76+
// adjust for browser env glob results have leading slash
77+
// make sure we dont remove these in Node, that would break absolute paths!!
78+
files = files.map((f) => f.replace(/^\//, ''));
79+
}
7780

7881
for (let i = 0; i < files.length; i++) {
7982
const filePath = files[i];

0 commit comments

Comments
 (0)
Please sign in to comment.