JSPM

  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q52928F
  • License Apache-2.0

A project which allows the user to convert SVGs into Vue components formatted to be used with the x-tailwindcss design system.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@empathyco/x-svg-converter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Convert SVGs into Vue components to use with the X Design System

    This project generates Vue components from SVGs in a folder, with the format required for the XDS

    How to use it

    Params

    It receives two parameters, the first one should be the path to the folder containing the SVGs. The second one indicates if the source SVG files should persist at the end of the process (--keep-svgs). By default, the SVGs are deleted.

    • sourcePath: path of the folder with the SVGs.
    • keepSVGs: indicates if the SVGs are preserved at the end. false by default.

    Run it as script

    Run the following command to generate a Vue component from each SVG in the source folder:

    ts-node ./src/svg-to-vue.ts ./yourSourceFolder

    If you want to keep the source SVGs, add the --keep-svgs param:

    ts-node ./src/svg-to-vue.ts ./yourSourceFolder --keep-svgs