{"id":26649,"library":"webpack-isomorphic-compiler","title":"Webpack Isomorphic Compiler","description":"Webpack isomorphic compiler (v3.1.1) synchronizes client and server webpack compilations for isomorphic/universal JavaScript apps with server-side rendering. Compatible with webpack v2–v4, released sporadically (last update 2020). Provides an aggregated compiler API with hooks, events, and compilation results (clientStats, serverStats, duration). Extends webpack-sane-compiler for compatibility with reporter and notifier tools. Key differentiator: simplifies isomorphic webpack setups by managing two compilers and ensuring they are in sync, unlike raw multi-compiler which lacks plugin handlers.","status":"maintenance","version":"3.1.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/moxystudio/webpack-isomorphic-compiler","tags":["javascript","webpack","isomorphic","server-side","rendering","render","compiler","compilation"],"install":[{"cmd":"npm install webpack-isomorphic-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-isomorphic-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-isomorphic-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: requires webpack >=2.0.0 <5.0.0","package":"webpack","optional":false}],"imports":[{"note":"Package exports a single default export (function). Use default import for ESM.","wrong":"const { isomorphicWebpack } = require('webpack-isomorphic-compiler')","symbol":"default","correct":"import isomorphicWebpack from 'webpack-isomorphic-compiler'"},{"note":"Named export ISOMORPHIC_COMPILER_EVENTS is an object with event constants (e.g., 'COMPILATION_DONE', 'CHUNK_ASSETS'). Must be imported alongside default export.","wrong":"import { ISOMORPHIC_COMPILER_EVENTS } from 'webpack-isomorphic-compiler'","symbol":"ISOMORPHIC_COMPILER_EVENTS","correct":"import isomorphicWebpack, { ISOMORPHIC_COMPILER_EVENTS } from 'webpack-isomorphic-compiler'"},{"note":"CommonJS require works directly. No need to destructure default.","wrong":"const { default: isomorphicWebpack } = require('webpack-isomorphic-compiler')","symbol":"default (require)","correct":"const isomorphicWebpack = require('webpack-isomorphic-compiler')"}],"quickstart":{"code":"const webpack = require('webpack');\nconst isomorphicWebpack = require('webpack-isomorphic-compiler');\n\nconst clientCompiler = webpack({\n  entry: './src/client.js',\n  output: { path: './dist/client', filename: 'bundle.js' },\n  target: 'web',\n});\n\nconst serverCompiler = webpack({\n  entry: './src/server.js',\n  output: { path: './dist/server', filename: 'server.js' },\n  target: 'node',\n});\n\nconst compiler = isomorphicWebpack(clientCompiler, serverCompiler);\n\ncompiler.run((err, { clientStats, serverStats, stats, duration }) => {\n  if (err) {\n    console.error('Compilation failed:', err);\n    return;\n  }\n  console.log(`Compilation took ${duration} ms`);\n  console.log('Client assets:', Object.keys(clientStats.compilation.assets));\n  console.log('Server assets:', Object.keys(serverStats.compilation.assets));\n});","lang":"javascript","description":"Creates two webpack compilers (client and server) and combines them using isomorphicWebpack. Runs the aggregated compiler and logs compilation stats."},"warnings":[{"fix":"Update webpack to version 2.x, 3.x, or 4.x.","message":"Version 3.0.0 dropped support for webpack <2.0.0. Ensure your webpack version is >=2.0.0 <5.0.0.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"If using webpack 5, look for alternatives or fork the package.","message":"Package has not been updated since 2020 and may not work with webpack 5. Consider migrating to webpack 5's built-in solutions or other libraries.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Access clientStats and serverStats directly; stats is identical to clientStats.","message":"The compiler.run() callback receives an error and an object with clientStats, serverStats, stats, duration. Do not expect stats to be a webpack Stats object; it is clientStats for compatibility.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Pass webpack compilers if you need full control over compiler instances.","message":"When passing config objects instead of compilers, ensure they are valid webpack configs. The library internally creates compilers using webpack(), so both configs must be present and valid.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install webpack-isomorphic-compiler --save-dev'.","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'webpack-isomorphic-compiler'"},{"fix":"Use 'import isomorphicWebpack from 'webpack-isomorphic-compiler'' or 'const isomorphicWebpack = require('webpack-isomorphic-compiler')'.","cause":"Using a named import (e.g., import { isomorphicWebpack }) instead of default import.","error":"TypeError: (0 , _default) is not a function"},{"fix":"Ensure both client and server configs are valid webpack configuration objects.","cause":"Webpack config object passed to isomorphicWebpack is invalid.","error":"Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}