question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

svg-to-ts-object generates consts

See original GitHub issue

Hello, I had previously and successfully configured for v7 and am now trying to configure with v8. My understanding is I should run npx svg-to-ts svg-to-ts-object and this replaces conversionType: "object" in the config. However, when I run npx svg-to-ts svg-to-ts-object, svg-to-ts generates consts and not an object. What am I doing wrong?

  "scripts": {
    "generate-icons": "npx svg-to-ts svg-to-ts-object"
  },
  "svg-to-ts": {
    "srcFiles": [
      "./src/icons/**/*.svg"
    ],
    "outputDirectory": "./src/icons",
    "objectName": "iconSvgStrings",
    "interfaceName": "IconSvgStringInterface",
    "typeName": "IconSvgStringType",
    "svgoConfig": {
      "plugins": [
        "cleanupAttrs"
      ]
    },
    "fileName": "index"
  },
Screen Shot 2022-02-15 at 9 52 06 AM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kreuzerkcommented, Feb 15, 2022

Sorry, you are right your command was correct. I overlooked the npx call. I will try to take a look

0reactions
kreuzerkcommented, Feb 15, 2022

Thx for reporting the issue 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJS: How to load SVG dynamically from an const object?
I'm trying to load SVG's dynamically via a const object to easily reuse in other blocks. But the SVG doens't show. When i...
Read more >
kreuzerk/svg-to-ts: Build performant SVG icon libraries by ...
svg -to-ts offers the possibility to generate TSX files (react components). offers three different conversion modes ('object', 'constants' and 'files'); each ...
Read more >
SVGTransformList - Web APIs | MDN
The consolidation operation creates new SVGTransform object as the first and only item in the list. The returned item is the item itself...
Read more >
React SVG: How to use SVGs best in React - CopyCat Blog
In this article, we'll look at react SVG - importing SVG into react, how to convert SVG to components, and much more.
Read more >
How to create svg elements with Javascript
How to create svg elements with Javascript ... const postNodes = posts.map((post) => { // Create the DOM elements const postCard = document....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found