Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Nov 5, 2024
1 parent 0c19944 commit 74419bf
Show file tree
Hide file tree
Showing 2 changed files with 640 additions and 493 deletions.
22 changes: 10 additions & 12 deletions packages/plugins/src/hd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,16 @@ export default (api: AlitaApi) => {
draftConfig.mako.px2rem = {
...px2remConfig,
// 将正则转成字符串
selectorDoubleList: px2remConfig.selectorDoubleRemList.map(
(i: string) => {
if (!(i instanceof RegExp)) return i;
const reStr = `${i}`.replaceAll('/', '');
if (hasMagicChars(reStr)) {
return reStr;
}
// FIXME: 更新 mako 的时候,需要修改这里,如果那边有修改配置,则要做出对应变动
// https://github.com/umijs/mako/blob/246ffd3440ec2705a1277c64fc0f554d68f0fe83/crates/mako/src/visitors/css_px2rem.rs#L152
return `(${reStr})`;
},
),
selectorDoubleList: px2remConfig.selectorDoubleRemList.map((i: any) => {
if (!(i instanceof RegExp)) return i;
const reStr = `${i}`.replaceAll('/', '');
if (hasMagicChars(reStr)) {
return reStr;
}
// FIXME: 更新 mako 的时候,需要修改这里,如果那边有修改配置,则要做出对应变动
// https://github.com/umijs/mako/blob/246ffd3440ec2705a1277c64fc0f554d68f0fe83/crates/mako/src/visitors/css_px2rem.rs#L152
return `(${reStr})`;
}),
};
delete draftConfig.mako.px2rem.selectorDoubleRemList;
}
Expand Down
Loading

0 comments on commit 74419bf

Please sign in to comment.