{"id":20732,"library":"webpack-config-single-spa-react","title":"webpack-config-single-spa-react","description":"A helper package for generating webpack configurations tailored for React microfrontends using single-spa. Current stable version is 8.0.0. Part of the create-single-spa ecosystem, it provides a pre-configured webpack setup that handles React JSX, CSS, asset loaders, and exposes the single-spa lifecycle hooks. It wraps webpack-config-single-spa and adds React-specific defaults. The package is designed to simplify the webpack configuration process for React apps in a microfrontend architecture, promoting consistency and best practices. It is actively maintained alongside other single-spa webpack config packages.","status":"active","version":"8.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/single-spa/create-single-spa","tags":["javascript","single-spa","react","webpack","microfrontends"],"install":[{"cmd":"npm install webpack-config-single-spa-react","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-config-single-spa-react","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-config-single-spa-react","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core webpack configuration for single-spa","package":"webpack-config-single-spa","optional":false},{"reason":"peer dependency for webpack configuration","package":"webpack","optional":false},{"reason":"peer dependency for running webpack","package":"webpack-cli","optional":true}],"imports":[{"note":"Default export is a module that can be called or merged into webpack config. CommonJS not supported.","wrong":"const webpackConfigSingleSpaReact = require('webpack-config-single-spa-react')","symbol":"default","correct":"import webpackConfigSingleSpaReact from 'webpack-config-single-spa-react'"},{"note":"This is a default export, not a named export. Named import will result in undefined.","wrong":"import { webpackConfigSingleSpaReact } from 'webpack-config-single-spa-react'","symbol":"webpackConfigSingleSpaReact","correct":"import webpackConfigSingleSpaReact from 'webpack-config-single-spa-react'"},{"note":"merge is not exported by this package. Use webpack-merge to combine configs.","wrong":"","symbol":"merge","correct":"import { merge } from 'webpack-merge'"}],"quickstart":{"code":"const singleSpaReact = require('single-spa-react');\n\n// webpack.config.js\nconst webpackConfigSingleSpaReact = require('webpack-config-single-spa-react');\n// Or in ESM:\n// import webpackConfigSingleSpaReact from 'webpack-config-single-spa-react';\n\nmodule.exports = (webpackConfigEnv, argv) => {\n  const defaultConfig = webpackConfigSingleSpaReact({\n    // options\n  });\n  return defaultConfig;\n};\n","lang":"javascript","description":"Shows how to import and use webpackConfigSingleSpaReact in a webpack config file, returning the generated config."},"warnings":[{"fix":"Review the changelog for standalone plugin updates and adjust your webpack config if needed.","message":"v8.0.0 upgraded standalone-single-spa-webpack-plugin which may require changes to standalone mode configuration.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Use ES module import syntax.","message":"CommonJS require() pattern is deprecated and may be removed in a future version.","severity":"deprecated","affected_versions":">=8.0.0"},{"fix":"Use default import or require without destructuring: import foo from '...' or const foo = require('...')","message":"The export is a default export, not named. Using named import will result in undefined.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade webpack to v5 or later.","message":"Webpack 5 is required; webpack 4 is not supported.","severity":"gotcha","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install webpack-config-single-spa-react --save-dev","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'webpack-config-single-spa-react'"},{"fix":"Use default import: import webpackConfigSingleSpaReact from 'webpack-config-single-spa-react';","cause":"The import is wrong (named instead of default) or variable name mismatch.","error":"TypeError: webpackConfigSingleSpaReact is not a function"},{"fix":"Upgrade webpack to v5 or later.","cause":"This package requires webpack v5+.","error":"Error: webpack v4 is not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}