Skip to content

Commit 88058e1

Browse files
committed
fix: correct the build copy
1 parent 5d36ed6 commit 88058e1

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

scripts/build-copy.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ fields.forEach((key) => {
4242
if (typeof pck[key] === 'object') {
4343
const keys = Object.keys(pck[key]);
4444
keys.forEach((subkey) => {
45-
pck[key][subkey] = pck[key][subkey]?.replace('./dist/', './');
45+
if (typeof pck[key][subkey] === 'string') {
46+
pck[key][subkey] = pck[key][subkey]?.replace('./dist/', './');
47+
} else if (typeof pck[key][subkey] === 'object') {
48+
const sub = pck[key][subkey];
49+
const subkeys = Object.keys(sub);
50+
subkeys.forEach((subsubkey) => {
51+
if (typeof sub[subsubkey] === 'string') {
52+
sub[subsubkey] = sub[subsubkey]?.replace('./dist/', './');
53+
}
54+
});
55+
}
4656
});
4757
} else {
4858
pck[key] = pck[key]?.replace('./dist/', './');

0 commit comments

Comments
 (0)