ts-loader VS svgr

Compare ts-loader vs svgr and see what are their differences.

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
ts-loader svgr
6 30
3,424 10,294
0.3% -
4.8 6.1
2 days ago 5 days ago
TypeScript TypeScript
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

ts-loader

Posts with mentions or reviews of ts-loader. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-12-14.
  • webpack adoption guide: Overview, examples, and alternatives
    1 project | dev.to | 8 Feb 2024
    It'll be a little different than your typical "what is webpack?" article in that I write this as the maintainer of ts-loader, a loader used for integrating TypeScript with webpack. I've worked in the webpack ecosystem for some years now, and I'll share some of my experiences with you.
  • The Complete Guide for Setting Up React App from Scratch (feat. TypeScript)
    16 projects | dev.to | 14 Dec 2022
    why I use @babel/preset-typescript over ts-loader and awesome-typescript-loader to complie TypeScript? it's blazingly faster than the others and has more perks(read #4) ts-loader doesn't natively support HMR(Hot Module Replacement) awesome-typescript-loader's latest release is on Jun 22, 2018 TypeScript With Babel: A Beautiful Marriage - Matt Turnbull's Post
  • Converting to Typescript
    3 projects | /r/reactjs | 1 Jun 2022
    Okay. The normal setup is that you use https://github.com/TypeStrong/ts-loader or https://github.com/TypeStrong/fork-ts-checker-webpack-plugin as part of your Webpack config. Those will run the TS compilation step as part of the Webpack processing sequence.
  • Using styled-components with SWC compiler?
    3 projects | /r/reactjs | 1 Aug 2021
    I've recently tried SWC for building my project instead of ts-loader and was blown away by its performance (I got 8x-10x speedup on a Windows machine).
  • Sharing TypeScript code between Node.js and Vue.js
    1 project | /r/vuejs | 7 Jul 2021
    { "compilerOptions": { "target": "esnext", "module": "esnext", "strict": true, "jsx": "preserve", "importHelpers": true, "moduleResolution": "node", "experimentalDecorators": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "sourceMap": true, "baseUrl": "./", "outDir": "./dist", // https://github.com/TypeStrong/ts-loader/issues/1138 "importsNotUsedAsValues": "preserve", "types": [ "webpack-env" ], "paths": { "@/*": [ "src/*" ], "@shared/*": [ "../shared/*" ] }, "lib": [ "esnext", "dom", "dom.iterable", "scripthost" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx", "../shared/**/*" ], "exclude": [ "node_modules" ] }
  • esbuild-loader: Replace babel-loader/ts-loader and benefit from the speed of esbuild while sticking with Webpack
    2 projects | /r/javascript | 28 Jan 2021
    See https://github.com/TypeStrong/ts-loader#happypackmode. Switching to esbuild-loader cut my build time in half.

svgr

Posts with mentions or reviews of svgr. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-27.
  • Nx + NextJS + Docker - The Nx way: Creating the NextJS application
    6 projects | dev.to | 27 Jun 2023
    //@ts-check // eslint-disable-next-line @typescript-eslint/no-var-requires const { composePlugins, withNx } = require('@nx/next'); /** * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/ const nextConfig = { nx: { // Set this to true if you would like to use SVGR // See: https://github.com/gregberge/svgr svgr: false, }, }; const plugins = [ // Add more Next.js plugins to this list if needed. withNx, ]; module.exports = composePlugins(...plugins)(nextConfig);
  • Easily use SVGs as JSX/TSX in your ReactJs app
    1 project | /r/reactjs | 19 Jun 2023
  • How do I use SVG icons in React?
    2 projects | /r/Frontend | 8 Apr 2023
  • SVGR for your React app
    1 project | dev.to | 12 Mar 2023
    Most of the time, developers tend to add svg images to an assets directory and import them either directly or as a React component. This process not only increases your app bundle size but also makes managing all the assets difficult. What if there was a way to manage all the application icons like the way we import them from any other icon library? Yes, react-svgr helps you manage all the icons in your React application.
  • What would be the best way to implement SVG's into your project?
    1 project | /r/Frontend | 26 Jan 2023
    If you are using react, there is a tool called SVGR, which will take in an SVG file and return a react component with all the props. This can be really useful if you want to treat SVG more like a markup that will be embedded directly into your HTML. This becomes really helpful when you want to style SVG through props or add transformations and animations. Using SVG directly in markup has so many perks and advantages to the point i don't use them as source in image tags.
  • One way of building an SVG icon library for your project
    2 projects | /r/javascript | 20 Jan 2023
    Really interesting framework agnostic approach, but I think SVGR is a better option for my React homies. It imports an SVG file as a React component. Shouts also to react-icons if Font Awesome, Material Icons and friends are more your bag.
  • Alternative libs to migrate from React to Vue (or Vue to React)
    12 projects | dev.to | 5 Jan 2023
    SVGR
  • Power up SVGs with React and CSS
    3 projects | dev.to | 4 Dec 2022
    There is another way to import an SVG in Create React App, though. We can import the SVG as a ReactComponent. This is because CRA leverages SVGR to process SVGs.
  • Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ React-ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Ρ‹ ΠΈΠΊΠΎΠ½ΠΎΠΊ с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ Figma API ΠΈ SVGR. Π§Π°ΡΡ‚ΡŒ 2.
    6 projects | dev.to | 16 Nov 2022
    const { types } = require('@babel/core'); module.exports = { ... template: function svgrCustomTemplate( { imports, interfaces, componentName, props, jsx, exports }, { tpl } ) { // мСняСм ΠΊΠΎΡ€Π½Π΅Π²ΠΎΠΉ элСмСнт Π½Π° SvgIcon jsx.openingElement.name.name = 'SvgIcon'; jsx.closingElement.name.name = 'SvgIcon'; // https://github.com/gregberge/svgr/issues/530 // ΠΏΡ€ΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΈ ΠΊΠΎΡ€Π½Π΅Π²ΠΎΠ³ΠΎ элСмСнта ΠΏΡ€ΠΎΠΏΠ°Π΄Π°Π΅Ρ‚ спрСд пропсов // поэтому Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ спрСд пропсов ΡΠ°ΠΌΠΎΡΡ‚ΠΎΡΡ‚Π΅Π»ΡŒΠ½ΠΎ jsx.openingElement.attributes.push( types.jSXSpreadAttribute(types.identifier('props')) ); return tpl` ${imports}; import { SvgIcon } from '../SvgIcon'; ${interfaces}; const ${componentName} = (${props}) => ( ${jsx} ); ${exports}; ` } }
  • How can I export an interactive figma component to an interactive react component?
    1 project | /r/UI_Design | 20 Aug 2022
    Is this an icon or icon set? Because you can absolutely change SVG icons into react components with SVGR. https://react-svgr.com/

What are some alternatives?

When comparing ts-loader and svgr you can also consider the following projects:

swc - Rust-based platform for the Web

svg-sprite-loader - Webpack loader for creating SVG sprites.

esbuild-loader - Webpack loader for esbuild: Speed up your build ⚑️

vite-plugin-svgr - Vite plugin to transform SVGs into React components

babel-plugin-styled-components - Improve the debugging experience and add server-side rendering support to styled-components

svgo - βš™οΈ Node.js tool for optimizing SVG files

raw-loader - A loader for webpack that allows importing files as a String

esbuild - An extremely fast bundler for the web

graphql-let - A webpack loader / babel-plugin / babel-plugin-macros / CLI / generated file manager of GraphQL code generator.

vite-plugin-svg-icons - Vite Plugin for fast creating SVG sprites.

responsive-loader - A webpack loader for responsive images