@redux-saga/unplugin weekly downloads statistics
By redux-saga · npm · Webpack plugins
Attaches source locations to sagas and effects so redux-saga can print saga stacks. One plugin for Vite, Rollup, Rolldown, webpack, Rspack and esbuild.
@redux-saga/unplugin has 24 recorded weekly downloads on npm, a change of 0.0% over the past 7 days, ranking #2958 of 3,247 tracked listings.
About @redux-saga/unplugin
@redux-saga/unplugin
Adds file names and line numbers to redux-saga's saga stacks. It attaches source-location metadata to your sagas and the effects they yield, which redux-saga reads when an error bubbles up to the root saga.
It is the successor to babel-plugin-redux-saga and produces the
same metadata, but doesn't need Babel: it parses with oxc and edits the source in
place, before TypeScript and JSX are stripped. One package covers Vite, Rollup, Rolldown, webpack,
Rspack and esbuild.
Example
Saga stack without the plugin:
The above error occurred in task throwAnErrorSaga
created by errorInCallAsyncSaga
created by takeEvery(ACTION_ERROR_IN_CALL_ASYNC, errorInCallAsyncSaga)
created by rootSaga
With the plugin:
The above error occurred in task throwAnErrorSaga src/sagas/index.js?16
created by errorInCallAsyncSaga src/sagas/index.js?25
created by takeEvery(ACTION_ERROR_IN_CALL_ASYNC, errorInCallAsyncSaga)
created by rootSaga src/sagas/index.js?78
The stack is passed to the onError middleware option as sagaStack (see
Troubleshooting).
Install
npm i --save-dev @redux-saga/unplugin
Requires Node 22.12 or later.
Usage
Each bundler has its own import path. For a complete Vite app, see the error-demo example.
Vite (and Vitest)
// vite.config.js
import reduxSaga from '@redux-saga/unplugin/vite'
export default {
plugins: [reduxSaga()],
}
Vitest uses your Vite config, so tests get saga stacks too.
Rollup / Rolldown
// rollup.config.js
import reduxSaga from '@redux-saga/unplugin/rollup' // or '@redux-saga/unplugin/rolldown'
export default {
plugins: [reduxSaga()],
}
Put it before plugins that compile TypeScript or JSX, so it sees your original code.
webpack / Rspack
Requires webpack 5 or Rspack 1.
// webpack.config.mjs
import reduxSaga from '@redux-saga/unplugin/webpack' // or '@redux-saga/unplugin/rspack'
export default {
plugins: [reduxSaga()],
}
In a CommonJS config, the plugin is the default export:
// webpack.config.js
const reduxSaga = require('@redux-saga/unplugin/webpack').default
module.exports = {
plugins: [reduxSaga()],
}
esbuild
import { build } from 'esbuild'
import reduxSaga from '@redux-saga/unplugin/esbuild'
await build({
entryPoints: ['src/index.js'],
bundle: true,
plugins: [reduxSaga()],
})
When it runs
The metadata is meant for development, so by default:
- Vite: the plugin runs unless Vite considers the build production (
isProduction). The dev server and Vitest are instrumented,vite buildis not, whatever its--mode. To instrument a build, run it withNODE_ENV=development vite build. - webpack / Rspack: the plugin runs when
modeisdevelopmentornone. With nomodeset, both bundlers build for production, so the plugin stays off. - Other bundlers: the plugin runs when
NODE_ENV !== 'production'.
Use the enabled option to override this.
Options
All options are optional.
| Option | Default | Description |
|---|---|---|
include | every .js/.jsx/.ts/.tsx/.mjs/.cjs/.mts/.cts file outside node_modules | String (matched as a substring of the file path, with / separators on every OS) or RegExp, or an array of them. |
exclude | none | Same format as include. |
cwd | Vite's root, webpack/Rspack's context, else process.cwd() | Directory file names are reported relative to. |
useAbsolutePath | false | Report absolute file names instead of relative ones. |
enabled | see When it runs | Force the plugin on or off. |
How it transforms your code
Source:
// src/sagas/index.js
function* saga1() {
yield call(foo, 1, 2, 3)
}
function* saga2() {
yield 2
}
Result (formatted for reading; the real output keeps every statement on its original line):
function* saga1() {
yield _extendSagaSourceLocation(call(foo, 1, 2, 3), {
fileName: 'src/sagas/index.js',
lineNumber: 3,
code: 'call(foo, 1, 2, 3)',
})
}
function* saga2() {
yield 2
}
_extendSagaSourceLocation(saga1, { fileName: 'src/sagas/index.js', lineNumber: 2, code: null })
_extendSagaSourceLocation(saga2, { fileName: 'src/sagas/index.js', lineNumber: 6, code: null })
function _extendSagaSourceLocation(value, location) {
// attaches `location` to objects and functions as '@@redux-saga/LOCATION';
// primitives and values that can't take the property are returned untouched
}
Function declarations are hoisted, so a saga can be used above the line it is written on. Their locations are therefore attached before the rest of the scope runs: after the imports and function declarations that open a file, or at the start of the enclosing function or block.…
Description from the npm listing.
- redux-saga
- unplugin
- vite-plugin
- rollup-plugin
- webpack-plugin
- rspack-plugin
- esbuild-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (135)Similar npm Webpack plugins plugins
All 20 @redux-saga/unplugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@redux-saga/unplugin. First seen Nov 21, 2026; last successful collection Dec 6, 2026. See the methodology.