Capítulo 10 de 57
File-based routing under Webpack installs @tanstack/router-plugin and adds tanstackRouter from @tanstack/router-plugin/webpack directly to webpack.config.ts's plugins array; Solid additionally requires a .babelrc with babel-preset-solid since SWC does not support Solid, and the same defaults/ignore-file guidance from the Vite chapter apply.
@tanstack/router-plugin/webpack: The Webpack-specific entry point for the plugin.tanstackRouter({ target: 'react', autoCodeSplitting: true }) directly in the top-level plugins array, no framework-plugin ordering concern is documented..babelrc requirement: { "presets": ["babel-preset-solid", "@babel/preset-typescript"] } is needed because SWC doesn't support solid-js.routesDirectory: "./src/routes", generatedRouteTree: "./src/routeTree.gen.ts", routeFileIgnorePrefix: "-", quoteStyle: "single".// webpack.config.ts
import { tanstackRouter } from '@tanstack/router-plugin/webpack'
export default {
plugins: [
tanstackRouter({
target: 'react',
autoCodeSplitting: true,
}),
],
}
babel-preset-solid configured via .babelrc, since SWC's Solid support is absent.routeTree.gen.ts in tooling are consistent across all bundler integrations (Vite, Rspack, Webpack, Esbuild).