Registry / web-framework / ssr-webpack

ssr-webpack

JSON →
library7.0.14jsnpmunverified

A framework-agnostic SSR webpack configuration for serverless deployment, supporting React (17/18/19) and Vue (2/3) with Vite, Webpack, or Rspack. Version 7.x (current 7.0.14) reduces dependency size by 2/3 and improves build speed 5-10x. Supports tight integration with Nest.js and Midway.js, and one-click deploy to Alibaba/Tencent Cloud Serverless. Actively maintained with weekly releases.

npm install ssr-webpack
INSTALL
IMPORT
SIG · SSR-WEBPACK
S
ssr-webpack
web-frameworkjavascriptv7.0.14
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.

ssr-webpack
import srrWebpack from 'ssr-webpack'
require('ssr-webpack')
Default export is the webpack config generator function. ESM-only since v7.
type ClientConfig
import type { ClientConfig } from 'ssr-webpack'
TypeScript type for client webpack config, available since v7.
type ServerConfig
import type { ServerConfig } from 'ssr-webpack'
TypeScript type for server webpack config.

Generates a client-side SSR webpack config with React plugin and environment variable injection.

import srrWebpack from 'ssr-webpack'; import { ReactSSR } from 'ssr-plugin-react'; const config = await srrWebpack({ type: 'client', chainWebpack: (chain) => { chain.plugin('define').tap(args => [{ ...args[0], 'process.env.API_BASE': JSON.stringify(process.env.API_BASE ?? 'http://localhost:3000/api') }]); }, plugins: [ new ReactSSR() ] }); // Export for webpack (e.g., webpack-merge) export default config;
Debug
Known issues
breakingv7 drops support for Node < 20. Upgrade Node to >= 20.
fix
Install Node.js 20 or later.
affects: >=7.0.0
breakingDefault export changed from a webpack config object to an async function generating config.
fix
Call srrWebpack() and await the result, not require('ssr-webpack') directly.
affects: >=7.0.0
breakingPlugin system changed in v7. Old plugin imports from 'ssr-plugin-*' v6 may not work.
fix
Update to @ssr/plugin-* packages and use new API.
affects: >=7.0.0
deprecatedThe inlineConfig option is deprecated. Use chainWebpack instead.
fix
Migrate overrides to chainWebpack callback.
affects: >=7.0.0
gotchaWhen using with Vue, must also install ssr-plugin-vue and configure accordingly.
fix
Add 'ssr-plugin-vue' to dependencies and import VueSSR plugin.
affects: >=7.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ssr-webpack'
Package not installed or wrong import path.
fix
Install package: npm install ssr-webpack@latest
TypeError: srrWebpack is not a function
Using CJS require() instead of ESM import, or importing wrong export.
fix
Use import srrWebpack from 'ssr-webpack' (ESM) or require('ssr-webpack').default
Error: The engine "node" is incompatible with this module.
Node version < 20.
fix
Upgrade Node to >= 20 and retry.
Upgrade
Version history
7.0.14latest on npm
Audit
Dependencies
webpackrequiredCore bundler used for SSR builds
Agent activity
16 hits · last 30 days
node
14
Resources
ssr-webpack — npm install ssr-webpack · libregistry