New v5 generate index.js feature does not account for filenames beginning with numerals
See original GitHub issue🐛 Bug Report
The index.${ext}
file that is now generated with v5
does not account for filenames beginning with numerals.
To Reproduce
Steps to reproduce the behavior:
- create folder with a file named:
2circles.svg
- run
svgr
cli command with--out-dir
option - inspect created
index.js
file - output should be:
export { default as 2circles } from './2circles.svg'
Expected behavior
Since the componentName
is generated from the .svg
filename and prepends the Svg
string to account for filenames with numerals, it would be expected for the generateIndex
function to be consistent and instead return the following for the example above:
export { default as Svg2circles } from './2circles.svg';
envinfo
## System:
- OS: Windows 10 10.0.16299
- CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
- Memory: 6.37 GB / 15.88 GB
## Binaries:
- Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
- npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
New v5 generate index.js feature does not account ... - GitHub
The index.${ext} file that is now generated with v5 does not account for filenames beginning with numerals. To Reproduce. Steps to reproduce the ......
Read more >Index API | Elasticsearch Guide [8.5] | Elastic
You can index a new JSON document with the _doc or _create resource. Using _create guarantees that the document is only indexed if...
Read more >Entry Points - webpack
Single Entry Syntax is a great choice when you are looking to quickly set up a webpack configuration for an application or tool...
Read more >webpack Tutorial: How to Set Up webpack 5 From Scratch
For the most part, websites are no longer just written in plain HTML with a bit of ... I'll start by creating a...
Read more >Error: Can't resolve 'core-js/es7/reflect' in '\node_modules ...
Removing the number at the end of 'es' in the path, like 'core-js ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TrySound since SVG starting with a number does not actually work, it would not be a breaking change.
I am OK for adding
Svg
prefix to all Svg starting with a number. I will not fix it right now, feel free to submit a PR.@gregberge https://github.com/gregberge/svgr/pull/383