@tanstack/router-plugin
Version:
Modern and scalable routing for React applications
1 lines • 1.41 kB
Source Map (JSON)
{"version":3,"file":"framework-plugins.cjs","names":[],"sources":["../../../../../src/core/code-splitter/plugins/framework-plugins.ts"],"sourcesContent":["import { createReactRefreshIgnoredRouteExportsPlugin } from './react-refresh-ignored-route-exports'\nimport { createReactRefreshRouteComponentsPlugin } from './react-refresh-route-components'\nimport { createReactStableHmrSplitRouteComponentsPlugin } from './react-stable-hmr-split-route-components'\nimport type { CodeSplitCompilerPlugin } from '../plugins'\nimport type { Config, HmrStyle } from '../../config'\n\nexport function getFrameworkHmrCompilerPlugins(opts: {\n targetFramework: Config['target']\n hmrStyle?: HmrStyle\n}): Array<CodeSplitCompilerPlugin> | undefined {\n switch (opts.targetFramework) {\n case 'react': {\n const hmrStyle = opts.hmrStyle ?? 'vite'\n return [\n ...(hmrStyle === 'vite'\n ? [createReactRefreshIgnoredRouteExportsPlugin()]\n : []),\n createReactRefreshRouteComponentsPlugin(),\n createReactStableHmrSplitRouteComponentsPlugin({ hmrStyle }),\n ]\n }\n default:\n return undefined\n }\n}\n"],"mappings":";;;;AAMA,SAAgB,+BAA+B,MAGA;CAC7C,QAAQ,KAAK,iBAAb;EACE,KAAK,SAAS;GACZ,MAAM,WAAW,KAAK,YAAY;GAClC,OAAO;IACL,GAAI,aAAa,SACb,CAAC,4CAAA,4CAA4C,CAAC,IAC9C,CAAC;IACL,uCAAA,wCAAwC;IACxC,gDAAA,+CAA+C,EAAE,SAAS,CAAC;GAC7D;EACF;EACA,SACE;CACJ;AACF"}