Skip to content
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

fix(build): include ?raw data to bundle #1128

Merged
merged 2 commits into from
Nov 26, 2023
Merged

fix(build): include ?raw data to bundle #1128

merged 2 commits into from
Nov 26, 2023

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Nov 25, 2023

Currently, importing raw SVG icons is externalized and used as it is in dist. However, such import is not valid and requires additional bundler configuration. Even when this library doesn't include CSS imports to the bundle.

Before in dist

import IconMove from '@mdi/svg/svg/folder-move.svg?raw'
import IconCopy from '@mdi/svg/svg/folder-multiple.svg?raw'

After

const IconMove = '<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-move" viewBox="0 0 24 24"><path d="M14,18V15H10V11H14V8L19,13M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z" /></svg>'
const IconCopy = '<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-multiple" viewBox="0 0 24 24"><path d="M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z" /></svg>'

Signed-off-by: Grigorii K. Shartsev <[email protected]>
@ShGKme ShGKme added the bug Something isn't working label Nov 25, 2023
@ShGKme ShGKme requested a review from susnux November 25, 2023 11:55
@ShGKme ShGKme self-assigned this Nov 25, 2023
Copy link

codecov bot commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a7d0227) 30.61% compared to head (8ded064) 30.61%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1128   +/-   ##
=======================================
  Coverage   30.61%   30.61%           
=======================================
  Files          16       16           
  Lines        1225     1225           
  Branches       60       60           
=======================================
  Hits          375      375           
  Misses        792      792           
  Partials       58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ShGKme ShGKme requested a review from skjnldsv November 25, 2023 12:19
@susnux
Copy link
Contributor

susnux commented Nov 25, 2023

In this case @mdi/svg can be moved to devDependencies

@ShGKme ShGKme merged commit fe50891 into main Nov 26, 2023
12 checks passed
@ShGKme ShGKme deleted the fix/raw-query-import branch November 26, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants