Registry / devops / shakapacker-rspack

shakapacker-rspack

JSON →
library10.1.0jsnpmunverified

Managed Rspack build support for Shakapacker. Version 10.1.0 provides a supplemental package that pairs shakapacker with the exact Rspack packages (@rspack/core, @rspack/cli, rspack-manifest-plugin) and related loaders that Shakapacker currently supports. It ships shakapacker as a direct dependency and declares required peer dependencies, simplifying dependency management. Release cadence follows shakapacker releases. Key differentiator: eliminates manual version matching of Rspack ecosystem packages, with auto-install on npm 7+ but requires explicit peer deps on pnpm/Yarn.

npm install shakapacker-rspack
INSTALL
IMPORT
SIG · SHAKAPACKER-RSPACK
S
shakapacker-rspack
devopsjavascriptv10.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

shakapacker
import 'shakapacker'; // or require('shakapacker')
import shakapacker from 'shakapacker-rspack'; // shakapacker-rspack bundles but re-exports differently
shakapacker-rspack does not re-export shakapacker; import shakapacker directly or via its subpath exports. ESM and CJS supported.
default rspack config
require('shakapacker/rspack')
require('shakapacker-rspack/rspack')
The rspack config file is provided by shakapacker, not by shakapacker-rspack. Import the path from shakapacker directly.
Use with Yarn 2+ PnP
yarn add --dev shakapacker-rspack shakapacker @rspack/core @rspack/cli rspack-manifest-plugin
yarn add --dev shakapacker-rspack (only) // missing peers causes resolution errors
Yarn PnP does not auto-install peer dependencies; they must be listed explicitly. Similar for pnpm.

Shows how to import and extend the default shakapacker Rspack config in a webpack.config.js (rspack.config.js).

const path = require('path'); const { config } = require('shakapacker/rspack'); module.exports = { ...config, entry: { main: './app/javascript/application.js' }, output: { path: path.resolve(__dirname, 'public/packs') }, mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', devServer: { hot: true }, };
Debug
Known issues
breakingshakapacker-rspack v10.1.0 requires Node ^20.19.0 || >=22.12.0; older versions will fail to install or run.
fix
Upgrade Node to v20.19.0+ or v22.12.0+.
affects: >=10.1.0
breakingshakapacker-rspack requires @rspack/core ^2.0.0, @rspack/cli ^2.0.0, and rspack-manifest-plugin ^5.0.0 as required peer dependencies. Missing peers can cause build failures.
fix
Install required peers explicitly: npm install --save-dev @rspack/core @rspack/cli rspack-manifest-plugin (or use npm 7+ auto-install).
affects: >=10.1.0
gotchaWith pnpm or Yarn PnP, peer dependencies are not auto-installed. Build will fail with 'Cannot find module' errors.
fix
Manually add shakapacker, @rspack/core, @rspack/cli, rspack-manifest-plugin as devDependencies in package.json.
affects: >=10.1.0
gotchaThe default rspack config import path is 'shakapacker/rspack', not 'shakapacker-rspack/rspack'.
fix
Use require('shakapacker/rspack') to get the managed config.
affects: >=10.1.0
deprecatedIf you were manually pinning @rspack versions before v10.1, you can remove them after switching to shakapacker-rspack, but only for required peers. Optional peers must stay if used.
fix
Remove @rspack/core, @rspack/cli, rspack-manifest-plugin from direct dependencies and let shakapacker-rspack manage them.
affects: <10.1.0
Errors
Common errors & fixes
Error: Cannot find module 'shakapacker/rspack'
shakapacker not installed as a direct dependency (or missing from node_modules).
fix
Run npm install --save-dev shakapacker (or ensure it's listed in package.json on pnpm/Yarn).
Error: Cannot find module '@rspack/core'
Required peer dependency @rspack/core is missing.
fix
Install it explicitly: npm install --save-dev @rspack/core (or equivalent for your package manager).
Error: The engine "node" is incompatible with this module. Expected version "^20.19.0 || >=22.12.0".
Node.js version is too old.
fix
Upgrade Node.js to v20.19.0+ or v22.12.0+.
error shakapacker-rspack@10.1.0: The engine "node" is incompatible with this module.
Same Node.js version mismatch when using Yarn.
fix
Upgrade Node.js to v20.19.0+ or v22.12.0+.
Upgrade
Version history
10.1.0latest on npm
Audit
Dependencies
shakapackerrequiredDirect dependency that provides the core Shakapacker integration; shakapacker-rspack bundles it.
@rspack/corerequiredRequired peer dependency; core Rspack build engine.
@rspack/clirequiredRequired peer dependency; provides the rspack CLI binary that shakapacker shells out to.
rspack-manifest-pluginrequiredRequired peer dependency; generates asset manifest for Shakapacker.
@rspack/plugin-react-refreshoptionalOptional peer; needed only for React refresh support.
css-loaderoptionalOptional peer; needed for CSS handling.
sassoptionalOptional peer; needed for SASS/SCSS support.
sass-loaderoptionalOptional peer; needed for SASS/SCSS support.
Agent activity
5 hits · last 30 days
node
4
Resources
shakapacker-rspack — npm install shakapacker-rspack · libregistry