I use create-react-app in my React project. when I run, build command it adds hash to file names.
I want to be able to change my media files after build. those that located at static/media
.
how can I prevent webpack to add hash to the filenames of svg
files.
only svg
files. I’m sure they have unique names so, not having hash won’t break the project.
2
Answers
Add the filename template w/o a hashing to the SVG rule:
You are using create-react-app, and using its workflow. This tool locks you into their webpack configuration
At the moment, you are importing them and using them that way. This will do magic things on the background like minification or even inlining of the file.
If you want a predictable URL, place the files inside the public folder and refer to the path of the file