Registry / devops / awesome-typescript-loader

awesome-typescript-loader

JSON →
library5.2.1jsnpmunverified

A TypeScript loader for Webpack 4.x that integrates with Babel and supports caching and forked type-checking. v5.2.1 is the latest stable release, targeting TypeScript 2.7+ and Webpack 4. Notably, the loader can fork the type-checker to a separate process for faster development builds. Offers first-class Babel integration with caching, significantly reducing rebuild times when combined. However, for Windows users, paths may need correction. The loader is considered a mature alternative to ts-loader but slower for some workloads; consider ts-loader with HappyPack or thread-loader for those cases. See GitHub for full README.

npm install awesome-typescript-loader
INSTALL
IMPORT
SIG · AWESOME-TYPESCRIPT
A
awesome-typescript-loader
devopsjavascriptv5.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

awesome-typescript-loader
module.exports = { module: { rules: [ { test: /\.tsx?$/, loader: 'awesome-typescript-loader' } ] } }
const atl = require('awesome-typescript-loader')
Use as a webpack loader rule, not as a direct import. The loader is configured via webpack config, not imported in source code.
CheckerPlugin
const { CheckerPlugin } = require('awesome-typescript-loader')
import { CheckerPlugin } from 'awesome-typescript-loader'
CheckerPlugin is a named export that is CommonJS exported. Use require for webpack config files (CJS). ESM import also works in webpack config, but require is common.
LoaderOptions
import { LoaderOptions } from 'awesome-typescript-loader'
const LoaderOptions = require('awesome-typescript-loader').LoaderOptions
TypeScript type import for loader options. Use import type for type-only imports if desired.

Minimal webpack configuration using awesome-typescript-loader with CheckerPlugin for async error reporting.

// webpack.config.js const path = require('path'); const { CheckerPlugin } = require('awesome-typescript-loader'); module.exports = { entry: './src/index.ts', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, resolve: { extensions: ['.ts', '.tsx', '.js', '.jsx'] }, devtool: 'source-map', module: { rules: [ { test: /\.tsx?$/, loader: 'awesome-typescript-loader' } ] }, plugins: [ new CheckerPlugin() ] };
Debug
Known issues
gotchaOn case-insensitive file systems (Windows/macOS), file path mismatches can cause 'Loader did not return a buffer of string' errors. Use Unix-style paths in tsconfig include/exclude.
fix
Use forward slashes in paths (e.g., './src/**/*.ts' instead of '.\src\**\*.ts').
affects: >=3.2.0
deprecatedUse of minimatch for file filtering in tsconfig was replaced by micromatch in v3.2.0.
fix
Upgrade to v3.2.0 or later; micromatch is more performant.
affects: <3.2.0
gotchaThe loader does not support HappyPack or thread-loader directly; for parallel builds, consider ts-loader with those plugins. ATL works better with hard-source-webpack-plugin for caching.
fix
Use hard-source-webpack-plugin for build caching; do not combine with thread-loader.
affects: >=5.0.0
breakingVersion 5.0.0 dropped support for TypeScript < 2.7 and Webpack < 4.
fix
Ensure you have TypeScript ^2.7 or ^3 and webpack 4.x.
affects: >=5.0.0
deprecatedThe 'silent' option may not silence all output; CheckerPlugin is needed for proper error reporting in watch mode.
fix
Use CheckerPlugin and optionally set 'errorsAsWarnings' to true.
affects: >=3.2.0
Errors
Common errors & fixes
Loader did not return a buffer or string
File path mismatches on case-insensitive file systems due to incorrect path casing in tsconfig.
fix
Ensure all paths in tsconfig.json use consistent casing and forward slashes.
TypeError: Cannot read property 'version' of undefined
Missing or incompatible peer dependency 'typescript' not installed or wrong version.
fix
Install TypeScript: npm install typescript --save-dev. Ensure version matches peer requirement (^2.7 || ^3).
Error: The 'CheckerPlugin' is only allowed when using watch mode or when using webpack-dev-server.
CheckerPlugin requires watch mode; it cannot be used in production builds without WatchIgnorePlugin.
fix
Remove CheckerPlugin for production builds or add WatchIgnorePlugin to ignore node_modules. Alternatively, use 'forceIsolatedModules' to skip type checking in production.
Upgrade
Version history
5.2.1latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency; requires TypeScript ^2.7 || ^3 for v5.x
Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
2
Amazon
1
Resources
awesome-typescript-loader — npm install awesome-typescript-loader · libregistry