{"id":25426,"library":"esbuild-plugin-webpack-bridge","title":"esbuild-plugin-webpack-bridge","description":"A plugin that enables using webpack loaders within esbuild builds. Current stable version is 0.4.0. Release cadence is irregular; the project is still under development with API subject to change. Key differentiator: bridges the gap between esbuild's speed and webpack's extensive loader ecosystem, allowing reuse of loaders like babel-loader, sass-loader, and postcss-loader without a full webpack setup. Works with ESM and CommonJS esbuild configurations.","status":"active","version":"0.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/igoradamenko/esbuild-plugin-webpack-bridge","tags":["javascript","esbuild","webpack","loader"],"install":[{"cmd":"npm install esbuild-plugin-webpack-bridge","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-webpack-bridge","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-webpack-bridge","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required to use the plugin.","package":"esbuild","optional":false}],"imports":[{"note":"Package does not provide a CommonJS export; use default import.","wrong":"const webpackBridge = require('esbuild-plugin-webpack-bridge')","symbol":"webpackBridge","correct":"import webpackBridge from 'esbuild-plugin-webpack-bridge'"},{"note":"Named import does not exist; use default import.","wrong":"const { webpackBridge } = require('esbuild-plugin-webpack-bridge')","symbol":"webpackBridge","correct":"import webpackBridge from 'esbuild-plugin-webpack-bridge'"},{"note":"esbuild is ESM-only; use dynamic import or import statement.","wrong":"const esbuild = require('esbuild')","symbol":"esbuild","correct":"import * as esbuild from 'esbuild'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport webpackBridge from 'esbuild-plugin-webpack-bridge';\n\nawait esbuild.build({\n  entryPoints: ['src/index.jsx'],\n  bundle: true,\n  outfile: 'dist/bundle.js',\n  plugins: [\n    webpackBridge({\n      module: {\n        rules: [\n          {\n            test: /\\.jsx?$/,\n            esbuildLoader: 'js',\n            use: [\n              {\n                loader: 'babel-loader',\n                options: {\n                  presets: [['@babel/preset-env', { targets: { ie: 11 } }]],\n                },\n              },\n            ],\n          },\n        ],\n      },\n    }),\n  ],\n});","lang":"javascript","description":"Shows how to use esbuild-plugin-webpack-bridge with a Babel loader for JSX/JS files."},"warnings":[{"fix":"Pin exact version in package.json and monitor releases for breaking changes.","message":"API changes in minor versions: the plugin is under development and the configuration format may break without major version bump.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Check test/ folder for supported features. Loaders expecting full webpack context may behave unexpectedly.","message":"Only a subset of webpack loader features are supported; for example, pitch loaders and inline matchResource may not work.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure Node version and esbuild peer dependency are satisfied.","message":"Requires Node.js >= 12 and esbuild >= 0.8; cannot be used in browsers.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Check if the loader relies on webpack internals; consider using a different loader or a workaround.","cause":"Some webpack loaders expect a full webpack compilation object, which is not provided by this plugin.","error":"TypeError: Cannot read properties of undefined (reading 'compilation')"},{"fix":"Install webpack as a dev dependency: npm install --save-dev webpack","cause":"The plugin depends on webpack internally but it is not installed.","error":"Error: Could not resolve 'webpack'"},{"fix":"Verify that the esbuildLoader property matches the expected content type (e.g., 'js' for JavaScript, 'css' for stylesheets).","cause":"The webpackBridge plugin might not be correctly applied or the rule's test doesn't match the file.","error":"Module parse failed: Unexpected token (1:0) - You may need an appropriate loader to handle this file type."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}