ts-loader VS swc

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

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
ts-loader swc
6 139
3,424 29,952
0.3% 1.2%
4.8 9.9
3 days ago 5 days ago
TypeScript Rust
MIT License Apache License 2.0
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.

swc

Posts with mentions or reviews of swc. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-06.
  • Storybook 8 Beta
    4 projects | dev.to | 6 Feb 2024
    First, we switched the default compiler for new projects from Babel to SWC (Speedy Web Compiler). SWC is dramatically faster than Babel and requires zero configuration. We’ll continue to support Babel in any project currently using it.
  • What is JSDoc and why you may not need typescript for your next project?
    8 projects | dev.to | 22 Jan 2024
    SWC
  • Implementing auth flow as fast as possible using NestJS
    5 projects | dev.to | 23 Oct 2023
    As the reference explains “**SWC** (Speedy Web Compiler) is an extensible Rust-based platform that can be used for both compilation and bundling. Using SWC with Nest CLI is a great and simple way to significantly speed up your development process.”
  • Ruby Outperforms C: Breaking the Catch-22
    4 projects | news.ycombinator.com | 9 Sep 2023
    This is specifically about breaking the myth that performing expensive self-contained operations (e.g, parsing GraphQL) in a native extension (C, Rust, etc.) is always faster than the interpreted language.

    The JS ecosystem has the same problem, people think rewriting everything in Rust will be a magic fix. In practice, there's always the problem highlighted in the post (transitioning is expensive, causes optimization bailouts), as well as the cost of actually getting the results back into Node-land. This is why SWC abandoned the JS API for writing plugins - constantly bouncing back and forth while traversing AST nodes was even slower than Babel (e.g https://github.com/swc-project/swc/issues/1392#issuecomment-...)

  • Building a Minimalist Docker Image with Node, TypeScript
    4 projects | dev.to | 5 Sep 2023
    Why Speedy Web Compiler ?
  • TypeScript Is Surprisingly OK for Compilers
    14 projects | news.ycombinator.com | 18 Aug 2023
  • Speedy Web Compiler: Rust-Based Platform for the Web
    1 project | news.ycombinator.com | 10 Aug 2023
  • FTA: Fast TypeScript Analyzer
    3 projects | dev.to | 2 Jul 2023
    FTA is a TypeScript static analysis tool built on the speedy foundations of swc. FTA is fast; capable of analyzing more than 150 files per second on typical hardware, it offers a powerful addition to your code quality toolkit.
  • Show HN: Ezno, a TypeScript checker written in Rust, is now open source
    4 projects | news.ycombinator.com | 7 Jun 2023
    Very cool! I'm curious, is this intended for dev tooling?

    For example, I could see this (or something similar) being useful as the engine for a typescript language server that would be faster than the standard one

    But if it's not aimed at 1:1 with tsc, would it be intended more for something like swc[1]?

    Or what would you expect people to use this for, besides just being a cool project to learn from?

    [1] https://github.com/swc-project/swc

  • TypeScript team released an explorer for performance tuning
    1 project | news.ycombinator.com | 13 May 2023
    This is... good news, but I still cannot fathom using the default Typescript compiler for regular development. Seriously, leave the type-checking to your IDE and CICD chain, and switch to using tsx (https://www.npmjs.com/package/tsx) or swc (https://swc.rs/) and you will _immediately_ notice the difference in speed and productivity.

What are some alternatives?

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

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

esbuild - An extremely fast bundler for the web

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

vite - Next generation frontend tooling. It's fast!

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

tsup - The simplest and fastest way to bundle your TypeScript libraries.

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

vitest - Next generation testing framework powered by Vite.

responsive-loader - A webpack loader for responsive images

ts-node - TypeScript execution and REPL for node.js

sass-loader - Compiles Sass to CSS

sucrase - Super-fast alternative to Babel for when you can target modern JS runtimes