mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-05-29 00:51:14 +08:00
Fix variable name casing in fileTransform (#7752)
This commit is contained in:
committed by
Brody McKee
parent
c0d73ba283
commit
fefd7169e9
@@ -13,10 +13,10 @@ module.exports = {
|
||||
if (filename.match(/\.svg$/)) {
|
||||
// Based on how SVGR generates a component name:
|
||||
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
|
||||
const pascalCaseFileName = camelcase(path.parse(filename).name, {
|
||||
const pascalCaseFilename = camelcase(path.parse(filename).name, {
|
||||
pascalCase: true,
|
||||
});
|
||||
const componentName = `Svg${pascalCaseFileName}`;
|
||||
const componentName = `Svg${pascalCaseFilename}`;
|
||||
return `const React = require('react');
|
||||
module.exports = {
|
||||
__esModule: true,
|
||||
|
||||
Reference in New Issue
Block a user