Skip to content

Commit

Permalink
fix(common): filter for rspack
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Mar 29, 2024
1 parent e3b741a commit 781d7dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-dots-listen.md
@@ -0,0 +1,5 @@
---
"@vue-macros/common": patch
---

fix filter for rspack
5 changes: 3 additions & 2 deletions packages/common/src/unplugin.ts
Expand Up @@ -81,11 +81,12 @@ export function getFilterPattern(
framework?: string,
): RegExp[] {
const filter: RegExp[] = []
const isWebpackLike = framework === 'webpack' || framework === 'rspack'
if (types.includes(FilterFileType.VUE_SFC)) {
filter.push(framework === 'webpack' ? REGEX_VUE_SUB : REGEX_VUE_SFC)
filter.push(isWebpackLike ? REGEX_VUE_SUB : REGEX_VUE_SFC)
}
if (types.includes(FilterFileType.VUE_SFC_WITH_SETUP)) {
filter.push(framework === 'webpack' ? REGEX_VUE_SUB_SETUP : REGEX_VUE_SFC)
filter.push(isWebpackLike ? REGEX_VUE_SUB_SETUP : REGEX_VUE_SFC)
}
if (types.includes(FilterFileType.SETUP_SFC)) {
filter.push(REGEX_SETUP_SFC)
Expand Down

0 comments on commit 781d7dc

Please sign in to comment.