Skip to content

Commit 100ff27

Browse files
authored
Merge pull request #24 from rollup-umd/dev
fix(createConfig): getComponentPathLine fix
2 parents 6bf2bbf + 1218ba1 commit 100ff27

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/createConfig.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,12 @@ export function createConfig(config = {}, options = {}) {
451451
} else if (/.svg$/.test(componentPath)) {
452452
// we can import svg as react component using @svgr/webpack
453453
name = basename(componentPath, '.svg');
454-
name = `${name[0].toUpperCase()}${name.slice(1)}`;
455454
key = 'ReactComponent';
456455
ext = '.svg';
457456
}
458457
const dir = name === 'index' ? dirname(componentPath) : `${dirname(componentPath)}/${name}`;
459458
name = name === 'index' ? basename(dir) : name;
460-
const es6import = key ? `{ ${key} as ${name} }` : name;
459+
const es6import = key ? `{ ${key} as ${name[0].toUpperCase()}${name.slice(1)} }` : name;
461460
return `import ${es6import} from '${pkg.name}/${dir.replace(/^src\//, 'lib/')}${ext}';`;
462461
},
463462
// this is useful for markdown generated with documentationjs

0 commit comments

Comments
 (0)