{"id":25856,"library":"laravel-mix-esbuild","title":"Laravel Mix esbuild","description":"Laravel Mix extension to replace babel-loader with esbuild-loader, significantly speeding up JavaScript/TypeScript compilation. Current stable version is 1.1.0. It adds an `esbuild()` method to your Mix pipeline with presets for React, TypeScript, JSX. Requires laravel-mix ^6.0 as a peer dependency. Unlike babel-based setups, this leverages esbuild's native fast transforms but with limited tsconfig support and no Vue SFC support.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/shaffe-fr/laravel-mix-esbuild","tags":["javascript","laravel mix","webpack","esbuild","esbuild-loader"],"install":[{"cmd":"npm install laravel-mix-esbuild","lang":"bash","label":"npm"},{"cmd":"yarn add laravel-mix-esbuild","lang":"bash","label":"yarn"},{"cmd":"pnpm add laravel-mix-esbuild","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; version ^6.0 required","package":"laravel-mix","optional":false}],"imports":[{"note":"This extension is designed for Laravel Mix's CommonJS environment; ESM import may not work.","wrong":"import 'laravel-mix-esbuild'","symbol":"default","correct":"require('laravel-mix-esbuild')"},{"note":"The method is added to mix after requiring the extension; it can be called without arguments for defaults.","wrong":"mix.esbuild(true)","symbol":"mix.esbuild","correct":"mix.esbuild('preset', options)"},{"note":"Presets are strings passed as first argument; object syntax is not supported.","wrong":"mix.esbuild({ preset: 'react' })","symbol":"presets","correct":"mix.esbuild('react')"}],"quickstart":{"code":"// webpack.mix.js\nconst mix = require('laravel-mix');\nrequire('laravel-mix-esbuild');\nmix\n    .js('resources/js/app.js', 'public/js')\n    .esbuild('ts', { target: 'es2020' });","lang":"javascript","description":"Shows basic setup: require the extension, then call esbuild() with a preset and options."},"warnings":[{"fix":"Use default babel-loader for Vue SFC or avoid using .vue files.","message":"Vue Single File Components (.vue) are NOT supported; Vue may work only without SFC.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add 'isolatedModules': true and 'esModuleInterop': true to tsconfig.json.","message":"esbuild only supports a subset of TypeScript compiler options; tsconfig must have isolatedModules and esModuleInterop.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run 'npm install acorn --save-dev'.","message":"React presets may require adding 'acorn' as a dependency.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check esbuild-loader changelog for breaking changes.","message":"No breaking changes known; but note that esbuild-loader may have its own breaking changes.","severity":"deprecated","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 laravel-mix-esbuild --save-dev'.","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'laravel-mix-esbuild'"},{"fix":"Ensure 'require('laravel-mix-esbuild')' is called before using mix.esbuild().","cause":"The require('laravel-mix-esbuild') is missing or placed after mix is used.","error":"mix.esbuild is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}