Skip to content

Commit f421e33

Browse files
committed
Fix component name check for webpack
fix #14
1 parent 9fc5ab4 commit f421e33

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

packages/core/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Fix component name check for webpack ([#14](https://github.com/bluwy/whyframe/issues/14))
6+
- Refactor files for unit tests
7+
38
## 0.1.7 (2022-10-14)
49

510
- Bump dependencies

packages/core/src/plugins/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function apiPlugin(options = {}) {
4646
!id.includes('__whyframe:') &&
4747
!id.includes('__whyframe-') &&
4848
(code.includes('<iframe') ||
49-
!!options.components?.some((n) => code.includes(`<${n.name}`)))
49+
!!options.components?.some((c) => code.includes(`<${c.name}`)))
5050
)
5151
},
5252
getDefaultShowSource() {

packages/core/src/webpack/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class WhyframePlugin {
147147
!id.includes('__whyframe:') &&
148148
!id.includes('__whyframe-') &&
149149
(code.includes('<iframe') ||
150-
!!this.#options.components?.some((n) => code.includes(`<${n}`)))
150+
!!this.#options.components?.some((c) => code.includes(`<${c.name}`)))
151151
)
152152
}
153153

0 commit comments

Comments
 (0)