-
-
Notifications
You must be signed in to change notification settings - Fork 27k
SVG files imported as React components should not end up in build directory #9167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Not stale. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Not stale. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
Not stale. |
It's critical when using Service Worker. Because SVG files also included in |
Intro
SVG files can be imported as React component, and thus inlined into the bundle, using the following syntax:
Actual behaviour
Although inlined, the original SVG files will still be processed (by Webpack?) and end up
build/static/media
folderasset-manifest.json
fileOverall, this isn't critical - it only means that unused files end up in the
build
folder. Nevertheless, it's a very confusing behaviour, developers might assume those files are being used or even that SVGs imported the way described above are not being inlined.Expected behaviour
The expected behaviour is that inlined resources do not end up in the build folder, resulting in a smaller and clean
build
folder.Related
The text was updated successfully, but these errors were encountered: