Skip to content

Commit

Permalink
improve regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Jan 12, 2025
1 parent 7031c44 commit 95fceb8
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions shared/web-components-vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export function useLocalWebComponents(webComponentsNodeModulesPath: string): Plu
if (/^(@polymer|@vaadin)/.test(id)) {
return this.resolve(path.join(webComponentsNodeModulesPath, id));
}
},
}
}
};
}

/**
Expand All @@ -37,31 +37,37 @@ export function useLitWebComponents(): PluginOption {
resolve: {
alias: [
'accordion',
'accordion-panel',
'app-layout',
'drawer-toggle',
'avatar',
'avatar-group',
'context-menu',
'custom-field',
'details',
'dialog',
'horizontal-layout',
'list-box',
'item',
'notification',
'radio-button',
'radio-button-group',
'scroller',
'split-layout',
'tabs',
'tab',
'tabsheet',
'vertical-layout'
].flatMap((component) => {
return [
{
find: new RegExp(`^@vaadin/${component}\/(src\/)?vaadin-(?!lit)`),
replacement: `@vaadin/${component}/$1vaadin-lit-`
find: new RegExp(`^@vaadin/[^\/]+\/(src\/)?vaadin-${component}.js`),
replacement: `@vaadin/[^\/]+/$1vaadin-lit-${component}.js`
}
]
];
})
},
}
}
};
}
}
};
}

0 comments on commit 95fceb8

Please sign in to comment.