Capítulo 11 de 57
File-based routing under Esbuild uses @tanstack/router-plugin/esbuild's tanstackRouter function registered in the plugins array; React's setup is a simple config object, while Solid requires building a full esbuild.context with solidPlugin() plus a manual dev/build/watch script since Esbuild has no built-in dev server story like Vite.
@tanstack/router-plugin/esbuild: The Esbuild-specific plugin entry point.esbuild.config.js exporting { plugins: [tanstackRouter({ target: 'react', autoCodeSplitting: true })] }.esbuild.context() with entryPoints, outfile, bundle, format: 'esm', and both solidPlugin() and tanstackRouter({ target: 'solid', autoCodeSplitting: true }), then calling ctx.watch() + ctx.serve() in dev mode or ctx.rebuild() + ctx.dispose() for production builds.routesDirectory/generatedRouteTree/routeFileIgnorePrefix/quoteStyle defaults and Prettier/ESLint/Biome/VSCode ignore recommendations as the other bundler chapters.// esbuild.config.js
import { tanstackRouter } from '@tanstack/router-plugin/esbuild'
export default {
plugins: [
tanstackRouter({
target: 'react',
autoCodeSplitting: true,
}),
],
}
ctx.watch() + ctx.serve() for development and ctx.rebuild() + ctx.dispose() for one-off production builds when using the Solid esbuild.context approach.@tanstack/router-plugin package for other bundlers.