mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-21 12:08:03 +02:00
fix: fix wrong regex that removes extra letters from swizzled component names (#5268)
This commit is contained in:
parent
8a198ef20a
commit
bd46de18f9
1 changed files with 2 additions and 2 deletions
|
@ -50,8 +50,8 @@ export function getPluginNames(plugins: PluginConfig[]): string[] {
|
||||||
|
|
||||||
const formatComponentName = (componentName: string): string =>
|
const formatComponentName = (componentName: string): string =>
|
||||||
componentName
|
componentName
|
||||||
.replace(/(\/|\\)index.(js|tsx|ts|jsx)/, '')
|
.replace(/(\/|\\)index\.(js|tsx|ts|jsx)/, '')
|
||||||
.replace(/.(js|tsx|ts|jsx)/, '');
|
.replace(/\.(js|tsx|ts|jsx)/, '');
|
||||||
|
|
||||||
function readComponent(themePath: string) {
|
function readComponent(themePath: string) {
|
||||||
function walk(dir: string): Array<string> {
|
function walk(dir: string): Array<string> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue