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

Added svg src directory and Jest transformer #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rb1193
Copy link

@rb1193 rb1193 commented Nov 29, 2020

Description

Creates a new SVG src directory for putting project SVGs in, and adds a jest transformer for SVG files. Two reasons for this:

  1. We usually keep SVG in the templates directory at the moment, but often import them into Vue, leading to tricky relative imports. It would be nice to have an alias for referencing them with. As they are shared between Vue and Twig, it seems nicer to keep them in the src folder and reference them either via a webpack alias or twigpack.

  2. I have to recreate the svg transformer I add in this PR in every project (nobody has created an npm package for it yet, amazingly). I could create the package I suppose, but creating a package for five lines of code I didn't write seems a bit off

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Test importing an SVG into a Vue file and running jest. Test should pass

Checklist:

  • My branch is up to date with master
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings and debugging code has been removed

Copy link
Contributor

@judereid judereid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @rb1193 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants