Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Commit 3d290a2

Browse files
committed
fix: ignore nodes that do not have a name
1 parent 7f5eb34 commit 3d290a2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ class WebpackReactComponentNamePlugin {
8282
))
8383
) {
8484
const variableDeclarator = ancestors.find(ancestor => ancestor.type === 'VariableDeclarator')
85-
86-
if (variableDeclarator) {
85+
if (variableDeclarator && variableDeclarator.id.name) {
8786
addDisplayName(parser, variableDeclarator)
8887
}
8988
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mockingjay-io/webpack-react-component-name",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Makes React component names public on minified bundles",
55
"main": "index.js",
66
"private": false,

0 commit comments

Comments
 (0)