Closed fb55 closed 4 years ago
@gajus Would appreciate a review!
What is the use case for this?
This patch gives you a more straight-forward (and less accidental) naming convention for default exports.
The intended use is for an application where components live in files named ComponentName/ComponentName.js
. We create ComponentName/index.js
files re-exporting the component so you can just import Component from ComponentName
.
Right now, a file called
default
will be added as the default export. This PR adds adefault
option that can be used to change this.By setting it to
match
, the default export will be set to a file matching the name of the current directory.