@tanstack/router-plugin 1.167.12 → 1.167.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/code-splitter/compilers.cjs +5 -4
- package/dist/cjs/core/code-splitter/compilers.cjs.map +1 -1
- package/dist/cjs/core/code-splitter/compilers.d.cts +2 -10
- package/dist/cjs/core/code-splitter/plugins/framework-plugins.cjs +2 -2
- package/dist/cjs/core/code-splitter/plugins/framework-plugins.cjs.map +1 -1
- package/dist/cjs/core/code-splitter/plugins/framework-plugins.d.cts +1 -0
- package/dist/cjs/core/code-splitter/plugins/react-refresh-ignored-route-exports.cjs +12 -6
- package/dist/cjs/core/code-splitter/plugins/react-refresh-ignored-route-exports.cjs.map +1 -1
- package/dist/cjs/core/code-splitter/plugins/react-refresh-ignored-route-exports.d.cts +3 -1
- package/dist/cjs/core/code-splitter/plugins/react-stable-hmr-split-route-components.cjs +12 -7
- package/dist/cjs/core/code-splitter/plugins/react-stable-hmr-split-route-components.cjs.map +1 -1
- package/dist/cjs/core/code-splitter/plugins/react-stable-hmr-split-route-components.d.cts +3 -1
- package/dist/cjs/core/code-splitter/plugins.d.cts +2 -0
- package/dist/cjs/core/config.cjs +4 -1
- package/dist/cjs/core/config.cjs.map +1 -1
- package/dist/cjs/core/config.d.cts +25 -0
- package/dist/cjs/core/hmr-hot-expression.cjs +27 -0
- package/dist/cjs/core/hmr-hot-expression.cjs.map +1 -0
- package/dist/cjs/core/hmr-hot-expression.d.cts +6 -0
- package/dist/cjs/core/route-autoimport-plugin.cjs +2 -2
- package/dist/cjs/core/route-hmr-statement.cjs +13 -10
- package/dist/cjs/core/route-hmr-statement.cjs.map +1 -1
- package/dist/cjs/core/route-hmr-statement.d.cts +3 -1
- package/dist/cjs/core/router-code-splitter-plugin.cjs +7 -10
- package/dist/cjs/core/router-code-splitter-plugin.cjs.map +1 -1
- package/dist/cjs/core/router-hmr-plugin.cjs +6 -2
- package/dist/cjs/core/router-hmr-plugin.cjs.map +1 -1
- package/dist/cjs/esbuild.d.cts +12 -0
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/rspack.cjs +3 -2
- package/dist/cjs/rspack.cjs.map +1 -1
- package/dist/cjs/rspack.d.cts +6 -135
- package/dist/cjs/vite.d.cts +15 -0
- package/dist/cjs/webpack.cjs +3 -2
- package/dist/cjs/webpack.cjs.map +1 -1
- package/dist/cjs/webpack.d.cts +6 -135
- package/dist/esm/core/code-splitter/compilers.d.ts +2 -10
- package/dist/esm/core/code-splitter/compilers.js +4 -3
- package/dist/esm/core/code-splitter/compilers.js.map +1 -1
- package/dist/esm/core/code-splitter/plugins/framework-plugins.d.ts +1 -0
- package/dist/esm/core/code-splitter/plugins/framework-plugins.js +2 -2
- package/dist/esm/core/code-splitter/plugins/framework-plugins.js.map +1 -1
- package/dist/esm/core/code-splitter/plugins/react-refresh-ignored-route-exports.d.ts +3 -1
- package/dist/esm/core/code-splitter/plugins/react-refresh-ignored-route-exports.js +11 -5
- package/dist/esm/core/code-splitter/plugins/react-refresh-ignored-route-exports.js.map +1 -1
- package/dist/esm/core/code-splitter/plugins/react-stable-hmr-split-route-components.d.ts +3 -1
- package/dist/esm/core/code-splitter/plugins/react-stable-hmr-split-route-components.js +11 -6
- package/dist/esm/core/code-splitter/plugins/react-stable-hmr-split-route-components.js.map +1 -1
- package/dist/esm/core/code-splitter/plugins.d.ts +2 -0
- package/dist/esm/core/config.d.ts +25 -0
- package/dist/esm/core/config.js +4 -1
- package/dist/esm/core/config.js.map +1 -1
- package/dist/esm/core/hmr-hot-expression.d.ts +6 -0
- package/dist/esm/core/hmr-hot-expression.js +23 -0
- package/dist/esm/core/hmr-hot-expression.js.map +1 -0
- package/dist/esm/core/route-autoimport-plugin.js +1 -1
- package/dist/esm/core/route-hmr-statement.d.ts +3 -1
- package/dist/esm/core/route-hmr-statement.js +13 -10
- package/dist/esm/core/route-hmr-statement.js.map +1 -1
- package/dist/esm/core/router-code-splitter-plugin.js +7 -10
- package/dist/esm/core/router-code-splitter-plugin.js.map +1 -1
- package/dist/esm/core/router-hmr-plugin.js +6 -2
- package/dist/esm/core/router-hmr-plugin.js.map +1 -1
- package/dist/esm/esbuild.d.ts +12 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/rspack.d.ts +6 -135
- package/dist/esm/rspack.js +3 -2
- package/dist/esm/rspack.js.map +1 -1
- package/dist/esm/vite.d.ts +15 -0
- package/dist/esm/webpack.d.ts +6 -135
- package/dist/esm/webpack.js +3 -2
- package/dist/esm/webpack.js.map +1 -1
- package/package.json +4 -4
- package/src/core/code-splitter/compilers.ts +8 -12
- package/src/core/code-splitter/plugins/framework-plugins.ts +7 -2
- package/src/core/code-splitter/plugins/react-refresh-ignored-route-exports.ts +12 -4
- package/src/core/code-splitter/plugins/react-stable-hmr-split-route-components.ts +14 -5
- package/src/core/code-splitter/plugins.ts +2 -0
- package/src/core/config.ts +9 -0
- package/src/core/hmr-hot-expression.ts +31 -0
- package/src/core/route-hmr-statement.ts +31 -22
- package/src/core/router-code-splitter-plugin.ts +8 -14
- package/src/core/router-hmr-plugin.ts +10 -1
- package/src/index.ts +1 -0
- package/src/rspack.ts +17 -2
- package/src/webpack.ts +17 -2
package/dist/cjs/esbuild.d.cts
CHANGED
|
@@ -33,6 +33,9 @@ declare const TanStackRouterGeneratorEsbuild: (options?: Partial<{
|
|
|
33
33
|
enableRouteGeneration?: boolean | undefined;
|
|
34
34
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
35
35
|
plugin?: {
|
|
36
|
+
hmr?: {
|
|
37
|
+
hotExpression?: string | undefined;
|
|
38
|
+
} | undefined;
|
|
36
39
|
vite?: {
|
|
37
40
|
environmentName?: string | undefined;
|
|
38
41
|
} | undefined;
|
|
@@ -87,6 +90,9 @@ declare const TanStackRouterCodeSplitterEsbuild: (options?: Partial<{
|
|
|
87
90
|
enableRouteGeneration?: boolean | undefined;
|
|
88
91
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
89
92
|
plugin?: {
|
|
93
|
+
hmr?: {
|
|
94
|
+
hotExpression?: string | undefined;
|
|
95
|
+
} | undefined;
|
|
90
96
|
vite?: {
|
|
91
97
|
environmentName?: string | undefined;
|
|
92
98
|
} | undefined;
|
|
@@ -141,6 +147,9 @@ declare const TanStackRouterEsbuild: (options?: Partial<{
|
|
|
141
147
|
enableRouteGeneration?: boolean | undefined;
|
|
142
148
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
143
149
|
plugin?: {
|
|
150
|
+
hmr?: {
|
|
151
|
+
hotExpression?: string | undefined;
|
|
152
|
+
} | undefined;
|
|
144
153
|
vite?: {
|
|
145
154
|
environmentName?: string | undefined;
|
|
146
155
|
} | undefined;
|
|
@@ -186,6 +195,9 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
186
195
|
enableRouteGeneration?: boolean | undefined;
|
|
187
196
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
188
197
|
plugin?: {
|
|
198
|
+
hmr?: {
|
|
199
|
+
hotExpression?: string | undefined;
|
|
200
|
+
} | undefined;
|
|
189
201
|
vite?: {
|
|
190
202
|
environmentName?: string | undefined;
|
|
191
203
|
} | undefined;
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { configSchema, getConfig } from './core/config.cjs';
|
|
2
2
|
export { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin.cjs';
|
|
3
3
|
export { unpluginRouterGeneratorFactory } from './core/router-generator-plugin.cjs';
|
|
4
|
-
export type { Config, ConfigInput, ConfigOutput, CodeSplittingOptions, DeletableNodes, } from './core/config.cjs';
|
|
4
|
+
export type { Config, ConfigInput, ConfigOutput, CodeSplittingOptions, DeletableNodes, HmrOptions, } from './core/config.cjs';
|
|
5
5
|
export { tsrSplit, splitRouteIdentNodes, defaultCodeSplitGroupings, } from './core/constants.cjs';
|
package/dist/cjs/rspack.cjs
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
require("./_virtual/_rolldown/runtime.cjs");
|
|
6
6
|
const require_config = require("./core/config.cjs");
|
|
7
|
+
const require_hmr_hot_expression = require("./core/hmr-hot-expression.cjs");
|
|
7
8
|
const require_router_code_splitter_plugin = require("./core/router-code-splitter-plugin.cjs");
|
|
8
9
|
const require_router_generator_plugin = require("./core/router-generator-plugin.cjs");
|
|
9
10
|
const require_router_composed_plugin = require("./core/router-composed-plugin.cjs");
|
|
@@ -36,7 +37,7 @@ var TanStackRouterGeneratorRspack = /* @__PURE__ */ (0, unplugin.createRspackPlu
|
|
|
36
37
|
* })
|
|
37
38
|
* ```
|
|
38
39
|
*/
|
|
39
|
-
var TanStackRouterCodeSplitterRspack = /* @__PURE__ */ (0, unplugin.createRspackPlugin)(require_router_code_splitter_plugin.unpluginRouterCodeSplitterFactory);
|
|
40
|
+
var TanStackRouterCodeSplitterRspack = /* @__PURE__ */ (0, unplugin.createRspackPlugin)((options, meta) => require_router_code_splitter_plugin.unpluginRouterCodeSplitterFactory(require_hmr_hot_expression.withHmrHotExpression(options, "import.meta.webpackHot"), meta));
|
|
40
41
|
/**
|
|
41
42
|
* @example
|
|
42
43
|
* ```ts
|
|
@@ -50,7 +51,7 @@ var TanStackRouterCodeSplitterRspack = /* @__PURE__ */ (0, unplugin.createRspack
|
|
|
50
51
|
* })
|
|
51
52
|
* ```
|
|
52
53
|
*/
|
|
53
|
-
var TanStackRouterRspack = /* @__PURE__ */ (0, unplugin.createRspackPlugin)(require_router_composed_plugin.unpluginRouterComposedFactory);
|
|
54
|
+
var TanStackRouterRspack = /* @__PURE__ */ (0, unplugin.createRspackPlugin)((options, meta) => require_router_composed_plugin.unpluginRouterComposedFactory(require_hmr_hot_expression.withHmrHotExpression(options, "import.meta.webpackHot"), meta));
|
|
54
55
|
var tanstackRouter = TanStackRouterRspack;
|
|
55
56
|
//#endregion
|
|
56
57
|
exports.TanStackRouterCodeSplitterRspack = TanStackRouterCodeSplitterRspack;
|
package/dist/cjs/rspack.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.cjs","names":[],"sources":["../../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from 'unplugin'\n\nimport { configSchema } from './core/config'\nimport { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin'\nimport { unpluginRouterGeneratorFactory } from './core/router-generator-plugin'\nimport { unpluginRouterComposedFactory } from './core/router-composed-plugin'\nimport type { CodeSplittingOptions, Config } from './core/config'\n\n/**\n * @example\n * ```ts\n * export default defineConfig({\n * // ...\n * tools: {\n * rspack: {\n * plugins: [TanStackRouterGeneratorRspack()],\n * },\n * },\n * })\n * ```\n */\nconst TanStackRouterGeneratorRspack = /* #__PURE__ */ createRspackPlugin(\n unpluginRouterGeneratorFactory,\n)\n\n/**\n * @example\n * ```ts\n * export default defineConfig({\n * // ...\n * tools: {\n * rspack: {\n * plugins: [TanStackRouterCodeSplitterRspack()],\n * },\n * },\n * })\n * ```\n */\nconst TanStackRouterCodeSplitterRspack = /* #__PURE__ */ createRspackPlugin(\n unpluginRouterCodeSplitterFactory,\n)\n\n/**\n * @example\n * ```ts\n * export default defineConfig({\n * // ...\n * tools: {\n * rspack: {\n * plugins: [tanstackRouter()],\n * },\n * },\n * })\n * ```\n */\nconst TanStackRouterRspack = /* #__PURE__ */ createRspackPlugin(\n unpluginRouterComposedFactory,\n)\nconst tanstackRouter = TanStackRouterRspack\nexport default TanStackRouterRspack\nexport {\n configSchema,\n TanStackRouterRspack,\n TanStackRouterGeneratorRspack,\n TanStackRouterCodeSplitterRspack,\n tanstackRouter,\n}\nexport type { Config, CodeSplittingOptions }\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"rspack.cjs","names":[],"sources":["../../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from 'unplugin'\n\nimport { configSchema } from './core/config'\nimport { withHmrHotExpression } from './core/hmr-hot-expression'\nimport { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin'\nimport { unpluginRouterGeneratorFactory } from './core/router-generator-plugin'\nimport { unpluginRouterComposedFactory } from './core/router-composed-plugin'\nimport type { CodeSplittingOptions, Config } from './core/config'\n\n/**\n * @example\n * ```ts\n * export default defineConfig({\n * // ...\n * tools: {\n * rspack: {\n * plugins: [TanStackRouterGeneratorRspack()],\n * },\n * },\n * })\n * ```\n */\nconst TanStackRouterGeneratorRspack = /* #__PURE__ */ createRspackPlugin(\n unpluginRouterGeneratorFactory,\n)\n\n/**\n * @example\n * ```ts\n * export default defineConfig({\n * // ...\n * tools: {\n * rspack: {\n * plugins: [TanStackRouterCodeSplitterRspack()],\n * },\n * },\n * })\n * ```\n */\nconst TanStackRouterCodeSplitterRspack = /* #__PURE__ */ createRspackPlugin(\n (options, meta) =>\n unpluginRouterCodeSplitterFactory(\n withHmrHotExpression(\n options as Partial<Config> | undefined,\n 'import.meta.webpackHot',\n ),\n meta,\n ),\n)\n\n/**\n * @example\n * ```ts\n * export default defineConfig({\n * // ...\n * tools: {\n * rspack: {\n * plugins: [tanstackRouter()],\n * },\n * },\n * })\n * ```\n */\nconst TanStackRouterRspack = /* #__PURE__ */ createRspackPlugin(\n (options, meta) =>\n unpluginRouterComposedFactory(\n withHmrHotExpression(\n options as Partial<Config> | undefined,\n 'import.meta.webpackHot',\n ),\n meta,\n ),\n)\nconst tanstackRouter = TanStackRouterRspack\nexport default TanStackRouterRspack\nexport {\n configSchema,\n TanStackRouterRspack,\n TanStackRouterGeneratorRspack,\n TanStackRouterCodeSplitterRspack,\n tanstackRouter,\n}\nexport type { Config, CodeSplittingOptions }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAM,gCAAgD,iBAAA,GAAA,SAAA,oBACpD,gCAAA,+BACD;;;;;;;;;;;;;;AAeD,IAAM,mCAAmD,iBAAA,GAAA,SAAA,qBACtD,SAAS,SACR,oCAAA,kCACE,2BAAA,qBACE,SACA,yBACD,EACD,KACD,CACJ;;;;;;;;;;;;;;AAeD,IAAM,uBAAuC,iBAAA,GAAA,SAAA,qBAC1C,SAAS,SACR,+BAAA,8BACE,2BAAA,qBACE,SACA,yBACD,EACD,KACD,CACJ;AACD,IAAM,iBAAiB"}
|
package/dist/cjs/rspack.d.cts
CHANGED
|
@@ -37,6 +37,9 @@ declare const TanStackRouterGeneratorRspack: (options?: Partial<{
|
|
|
37
37
|
enableRouteGeneration?: boolean | undefined;
|
|
38
38
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
39
39
|
plugin?: {
|
|
40
|
+
hmr?: {
|
|
41
|
+
hotExpression?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
40
43
|
vite?: {
|
|
41
44
|
environmentName?: string | undefined;
|
|
42
45
|
} | undefined;
|
|
@@ -70,51 +73,7 @@ declare const TanStackRouterGeneratorRspack: (options?: Partial<{
|
|
|
70
73
|
* })
|
|
71
74
|
* ```
|
|
72
75
|
*/
|
|
73
|
-
declare const TanStackRouterCodeSplitterRspack: (options?:
|
|
74
|
-
target: "react" | "solid" | "vue";
|
|
75
|
-
routeFileIgnorePrefix: string;
|
|
76
|
-
routesDirectory: string;
|
|
77
|
-
quoteStyle: "single" | "double";
|
|
78
|
-
semicolons: boolean;
|
|
79
|
-
disableLogging: boolean;
|
|
80
|
-
routeTreeFileHeader: string[];
|
|
81
|
-
indexToken: string | RegExp | {
|
|
82
|
-
regex: string;
|
|
83
|
-
flags?: string | undefined;
|
|
84
|
-
};
|
|
85
|
-
routeToken: string | RegExp | {
|
|
86
|
-
regex: string;
|
|
87
|
-
flags?: string | undefined;
|
|
88
|
-
};
|
|
89
|
-
generatedRouteTree: string;
|
|
90
|
-
disableTypes: boolean;
|
|
91
|
-
addExtensions: string | boolean;
|
|
92
|
-
enableRouteTreeFormatting: boolean;
|
|
93
|
-
tmpDir: string;
|
|
94
|
-
importRoutesUsingAbsolutePaths: boolean;
|
|
95
|
-
enableRouteGeneration?: boolean | undefined;
|
|
96
|
-
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
97
|
-
plugin?: {
|
|
98
|
-
vite?: {
|
|
99
|
-
environmentName?: string | undefined;
|
|
100
|
-
} | undefined;
|
|
101
|
-
} | undefined;
|
|
102
|
-
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
103
|
-
routeFilePrefix?: string | undefined;
|
|
104
|
-
routeFileIgnorePattern?: string | undefined;
|
|
105
|
-
pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
|
|
106
|
-
verboseFileRoutes?: boolean | undefined;
|
|
107
|
-
routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
|
|
108
|
-
autoCodeSplitting?: boolean | undefined;
|
|
109
|
-
customScaffolding?: {
|
|
110
|
-
routeTemplate?: string | undefined;
|
|
111
|
-
lazyRouteTemplate?: string | undefined;
|
|
112
|
-
} | undefined;
|
|
113
|
-
experimental?: {
|
|
114
|
-
enableCodeSplitting?: boolean | undefined;
|
|
115
|
-
} | undefined;
|
|
116
|
-
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
117
|
-
} | (() => Config)> | undefined) => import('unplugin').RspackPluginInstance;
|
|
76
|
+
declare const TanStackRouterCodeSplitterRspack: (options?: unknown) => import('unplugin').RspackPluginInstance;
|
|
118
77
|
/**
|
|
119
78
|
* @example
|
|
120
79
|
* ```ts
|
|
@@ -128,96 +87,8 @@ declare const TanStackRouterCodeSplitterRspack: (options?: Partial<{
|
|
|
128
87
|
* })
|
|
129
88
|
* ```
|
|
130
89
|
*/
|
|
131
|
-
declare const TanStackRouterRspack: (options?:
|
|
132
|
-
|
|
133
|
-
routeFileIgnorePrefix: string;
|
|
134
|
-
routesDirectory: string;
|
|
135
|
-
quoteStyle: "single" | "double";
|
|
136
|
-
semicolons: boolean;
|
|
137
|
-
disableLogging: boolean;
|
|
138
|
-
routeTreeFileHeader: string[];
|
|
139
|
-
indexToken: string | RegExp | {
|
|
140
|
-
regex: string;
|
|
141
|
-
flags?: string | undefined;
|
|
142
|
-
};
|
|
143
|
-
routeToken: string | RegExp | {
|
|
144
|
-
regex: string;
|
|
145
|
-
flags?: string | undefined;
|
|
146
|
-
};
|
|
147
|
-
generatedRouteTree: string;
|
|
148
|
-
disableTypes: boolean;
|
|
149
|
-
addExtensions: string | boolean;
|
|
150
|
-
enableRouteTreeFormatting: boolean;
|
|
151
|
-
tmpDir: string;
|
|
152
|
-
importRoutesUsingAbsolutePaths: boolean;
|
|
153
|
-
enableRouteGeneration?: boolean | undefined;
|
|
154
|
-
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
155
|
-
plugin?: {
|
|
156
|
-
vite?: {
|
|
157
|
-
environmentName?: string | undefined;
|
|
158
|
-
} | undefined;
|
|
159
|
-
} | undefined;
|
|
160
|
-
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
161
|
-
routeFilePrefix?: string | undefined;
|
|
162
|
-
routeFileIgnorePattern?: string | undefined;
|
|
163
|
-
pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
|
|
164
|
-
verboseFileRoutes?: boolean | undefined;
|
|
165
|
-
routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
|
|
166
|
-
autoCodeSplitting?: boolean | undefined;
|
|
167
|
-
customScaffolding?: {
|
|
168
|
-
routeTemplate?: string | undefined;
|
|
169
|
-
lazyRouteTemplate?: string | undefined;
|
|
170
|
-
} | undefined;
|
|
171
|
-
experimental?: {
|
|
172
|
-
enableCodeSplitting?: boolean | undefined;
|
|
173
|
-
} | undefined;
|
|
174
|
-
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
175
|
-
}> | undefined) => import('unplugin').RspackPluginInstance;
|
|
176
|
-
declare const tanstackRouter: (options?: Partial<{
|
|
177
|
-
target: "react" | "solid" | "vue";
|
|
178
|
-
routeFileIgnorePrefix: string;
|
|
179
|
-
routesDirectory: string;
|
|
180
|
-
quoteStyle: "single" | "double";
|
|
181
|
-
semicolons: boolean;
|
|
182
|
-
disableLogging: boolean;
|
|
183
|
-
routeTreeFileHeader: string[];
|
|
184
|
-
indexToken: string | RegExp | {
|
|
185
|
-
regex: string;
|
|
186
|
-
flags?: string | undefined;
|
|
187
|
-
};
|
|
188
|
-
routeToken: string | RegExp | {
|
|
189
|
-
regex: string;
|
|
190
|
-
flags?: string | undefined;
|
|
191
|
-
};
|
|
192
|
-
generatedRouteTree: string;
|
|
193
|
-
disableTypes: boolean;
|
|
194
|
-
addExtensions: string | boolean;
|
|
195
|
-
enableRouteTreeFormatting: boolean;
|
|
196
|
-
tmpDir: string;
|
|
197
|
-
importRoutesUsingAbsolutePaths: boolean;
|
|
198
|
-
enableRouteGeneration?: boolean | undefined;
|
|
199
|
-
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
200
|
-
plugin?: {
|
|
201
|
-
vite?: {
|
|
202
|
-
environmentName?: string | undefined;
|
|
203
|
-
} | undefined;
|
|
204
|
-
} | undefined;
|
|
205
|
-
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
206
|
-
routeFilePrefix?: string | undefined;
|
|
207
|
-
routeFileIgnorePattern?: string | undefined;
|
|
208
|
-
pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
|
|
209
|
-
verboseFileRoutes?: boolean | undefined;
|
|
210
|
-
routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
|
|
211
|
-
autoCodeSplitting?: boolean | undefined;
|
|
212
|
-
customScaffolding?: {
|
|
213
|
-
routeTemplate?: string | undefined;
|
|
214
|
-
lazyRouteTemplate?: string | undefined;
|
|
215
|
-
} | undefined;
|
|
216
|
-
experimental?: {
|
|
217
|
-
enableCodeSplitting?: boolean | undefined;
|
|
218
|
-
} | undefined;
|
|
219
|
-
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
220
|
-
}> | undefined) => import('unplugin').RspackPluginInstance;
|
|
90
|
+
declare const TanStackRouterRspack: (options?: unknown) => import('unplugin').RspackPluginInstance;
|
|
91
|
+
declare const tanstackRouter: (options?: unknown) => import('unplugin').RspackPluginInstance;
|
|
221
92
|
export default TanStackRouterRspack;
|
|
222
93
|
export { configSchema, TanStackRouterRspack, TanStackRouterGeneratorRspack, TanStackRouterCodeSplitterRspack, tanstackRouter, };
|
|
223
94
|
export type { Config, CodeSplittingOptions };
|
package/dist/cjs/vite.d.cts
CHANGED
|
@@ -24,6 +24,9 @@ declare const tanstackRouterAutoImport: (options?: Partial<{
|
|
|
24
24
|
enableRouteGeneration?: boolean | undefined;
|
|
25
25
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
26
26
|
plugin?: {
|
|
27
|
+
hmr?: {
|
|
28
|
+
hotExpression?: string | undefined;
|
|
29
|
+
} | undefined;
|
|
27
30
|
vite?: {
|
|
28
31
|
environmentName?: string | undefined;
|
|
29
32
|
} | undefined;
|
|
@@ -78,6 +81,9 @@ declare const tanstackRouterGenerator: (options?: Partial<{
|
|
|
78
81
|
enableRouteGeneration?: boolean | undefined;
|
|
79
82
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
80
83
|
plugin?: {
|
|
84
|
+
hmr?: {
|
|
85
|
+
hotExpression?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
81
87
|
vite?: {
|
|
82
88
|
environmentName?: string | undefined;
|
|
83
89
|
} | undefined;
|
|
@@ -132,6 +138,9 @@ declare const tanStackRouterCodeSplitter: (options?: Partial<{
|
|
|
132
138
|
enableRouteGeneration?: boolean | undefined;
|
|
133
139
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
134
140
|
plugin?: {
|
|
141
|
+
hmr?: {
|
|
142
|
+
hotExpression?: string | undefined;
|
|
143
|
+
} | undefined;
|
|
135
144
|
vite?: {
|
|
136
145
|
environmentName?: string | undefined;
|
|
137
146
|
} | undefined;
|
|
@@ -186,6 +195,9 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
186
195
|
enableRouteGeneration?: boolean | undefined;
|
|
187
196
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
188
197
|
plugin?: {
|
|
198
|
+
hmr?: {
|
|
199
|
+
hotExpression?: string | undefined;
|
|
200
|
+
} | undefined;
|
|
189
201
|
vite?: {
|
|
190
202
|
environmentName?: string | undefined;
|
|
191
203
|
} | undefined;
|
|
@@ -234,6 +246,9 @@ declare const TanStackRouterVite: (options?: Partial<{
|
|
|
234
246
|
enableRouteGeneration?: boolean | undefined;
|
|
235
247
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
236
248
|
plugin?: {
|
|
249
|
+
hmr?: {
|
|
250
|
+
hotExpression?: string | undefined;
|
|
251
|
+
} | undefined;
|
|
237
252
|
vite?: {
|
|
238
253
|
environmentName?: string | undefined;
|
|
239
254
|
} | undefined;
|
package/dist/cjs/webpack.cjs
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
require("./_virtual/_rolldown/runtime.cjs");
|
|
6
6
|
const require_config = require("./core/config.cjs");
|
|
7
|
+
const require_hmr_hot_expression = require("./core/hmr-hot-expression.cjs");
|
|
7
8
|
const require_router_code_splitter_plugin = require("./core/router-code-splitter-plugin.cjs");
|
|
8
9
|
const require_router_generator_plugin = require("./core/router-generator-plugin.cjs");
|
|
9
10
|
const require_router_composed_plugin = require("./core/router-composed-plugin.cjs");
|
|
@@ -28,7 +29,7 @@ var TanStackRouterGeneratorWebpack = /* @__PURE__ */ (0, unplugin.createWebpackP
|
|
|
28
29
|
* }
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
|
-
var TanStackRouterCodeSplitterWebpack = /* @__PURE__ */ (0, unplugin.createWebpackPlugin)(require_router_code_splitter_plugin.unpluginRouterCodeSplitterFactory);
|
|
32
|
+
var TanStackRouterCodeSplitterWebpack = /* @__PURE__ */ (0, unplugin.createWebpackPlugin)((options, meta) => require_router_code_splitter_plugin.unpluginRouterCodeSplitterFactory(require_hmr_hot_expression.withHmrHotExpression(options, "import.meta.webpackHot"), meta));
|
|
32
33
|
/**
|
|
33
34
|
* @example
|
|
34
35
|
* ```ts
|
|
@@ -38,7 +39,7 @@ var TanStackRouterCodeSplitterWebpack = /* @__PURE__ */ (0, unplugin.createWebpa
|
|
|
38
39
|
* }
|
|
39
40
|
* ```
|
|
40
41
|
*/
|
|
41
|
-
var TanStackRouterWebpack = /* @__PURE__ */ (0, unplugin.createWebpackPlugin)(require_router_composed_plugin.unpluginRouterComposedFactory);
|
|
42
|
+
var TanStackRouterWebpack = /* @__PURE__ */ (0, unplugin.createWebpackPlugin)((options, meta) => require_router_composed_plugin.unpluginRouterComposedFactory(require_hmr_hot_expression.withHmrHotExpression(options, "import.meta.webpackHot"), meta));
|
|
42
43
|
var tanstackRouter = TanStackRouterWebpack;
|
|
43
44
|
//#endregion
|
|
44
45
|
exports.TanStackRouterCodeSplitterWebpack = TanStackRouterCodeSplitterWebpack;
|
package/dist/cjs/webpack.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.cjs","names":[],"sources":["../../src/webpack.ts"],"sourcesContent":["import { createWebpackPlugin } from 'unplugin'\n\nimport { configSchema } from './core/config'\nimport { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin'\nimport { unpluginRouterGeneratorFactory } from './core/router-generator-plugin'\nimport { unpluginRouterComposedFactory } from './core/router-composed-plugin'\nimport type { CodeSplittingOptions, Config } from './core/config'\n\n/**\n * @example\n * ```ts\n * export default {\n * // ...\n * plugins: [TanStackRouterGeneratorWebpack()],\n * }\n * ```\n */\nconst TanStackRouterGeneratorWebpack = /* #__PURE__ */ createWebpackPlugin(\n unpluginRouterGeneratorFactory,\n)\n\n/**\n * @example\n * ```ts\n * export default {\n * // ...\n * plugins: [TanStackRouterCodeSplitterWebpack()],\n * }\n * ```\n */\nconst TanStackRouterCodeSplitterWebpack = /* #__PURE__ */ createWebpackPlugin(\n unpluginRouterCodeSplitterFactory,\n)\n\n/**\n * @example\n * ```ts\n * export default {\n * // ...\n * plugins: [tanstackRouter()],\n * }\n * ```\n */\nconst TanStackRouterWebpack = /* #__PURE__ */ createWebpackPlugin(\n unpluginRouterComposedFactory,\n)\n\nconst tanstackRouter = TanStackRouterWebpack\nexport default TanStackRouterWebpack\nexport {\n configSchema,\n TanStackRouterWebpack,\n TanStackRouterGeneratorWebpack,\n TanStackRouterCodeSplitterWebpack,\n tanstackRouter,\n}\nexport type { Config, CodeSplittingOptions }\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack.cjs","names":[],"sources":["../../src/webpack.ts"],"sourcesContent":["import { createWebpackPlugin } from 'unplugin'\n\nimport { configSchema } from './core/config'\nimport { withHmrHotExpression } from './core/hmr-hot-expression'\nimport { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin'\nimport { unpluginRouterGeneratorFactory } from './core/router-generator-plugin'\nimport { unpluginRouterComposedFactory } from './core/router-composed-plugin'\nimport type { CodeSplittingOptions, Config } from './core/config'\n\n/**\n * @example\n * ```ts\n * export default {\n * // ...\n * plugins: [TanStackRouterGeneratorWebpack()],\n * }\n * ```\n */\nconst TanStackRouterGeneratorWebpack = /* #__PURE__ */ createWebpackPlugin(\n unpluginRouterGeneratorFactory,\n)\n\n/**\n * @example\n * ```ts\n * export default {\n * // ...\n * plugins: [TanStackRouterCodeSplitterWebpack()],\n * }\n * ```\n */\nconst TanStackRouterCodeSplitterWebpack = /* #__PURE__ */ createWebpackPlugin(\n (options, meta) =>\n unpluginRouterCodeSplitterFactory(\n withHmrHotExpression(\n options as Partial<Config> | undefined,\n 'import.meta.webpackHot',\n ),\n meta,\n ),\n)\n\n/**\n * @example\n * ```ts\n * export default {\n * // ...\n * plugins: [tanstackRouter()],\n * }\n * ```\n */\nconst TanStackRouterWebpack = /* #__PURE__ */ createWebpackPlugin(\n (options, meta) =>\n unpluginRouterComposedFactory(\n withHmrHotExpression(\n options as Partial<Config> | undefined,\n 'import.meta.webpackHot',\n ),\n meta,\n ),\n)\n\nconst tanstackRouter = TanStackRouterWebpack\nexport default TanStackRouterWebpack\nexport {\n configSchema,\n TanStackRouterWebpack,\n TanStackRouterGeneratorWebpack,\n TanStackRouterCodeSplitterWebpack,\n tanstackRouter,\n}\nexport type { Config, CodeSplittingOptions }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkBA,IAAM,iCAAiD,iBAAA,GAAA,SAAA,qBACrD,gCAAA,+BACD;;;;;;;;;;AAWD,IAAM,oCAAoD,iBAAA,GAAA,SAAA,sBACvD,SAAS,SACR,oCAAA,kCACE,2BAAA,qBACE,SACA,yBACD,EACD,KACD,CACJ;;;;;;;;;;AAWD,IAAM,wBAAwC,iBAAA,GAAA,SAAA,sBAC3C,SAAS,SACR,+BAAA,8BACE,2BAAA,qBACE,SACA,yBACD,EACD,KACD,CACJ;AAED,IAAM,iBAAiB"}
|
package/dist/cjs/webpack.d.cts
CHANGED
|
@@ -33,6 +33,9 @@ declare const TanStackRouterGeneratorWebpack: (options?: Partial<{
|
|
|
33
33
|
enableRouteGeneration?: boolean | undefined;
|
|
34
34
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
35
35
|
plugin?: {
|
|
36
|
+
hmr?: {
|
|
37
|
+
hotExpression?: string | undefined;
|
|
38
|
+
} | undefined;
|
|
36
39
|
vite?: {
|
|
37
40
|
environmentName?: string | undefined;
|
|
38
41
|
} | undefined;
|
|
@@ -62,51 +65,7 @@ declare const TanStackRouterGeneratorWebpack: (options?: Partial<{
|
|
|
62
65
|
* }
|
|
63
66
|
* ```
|
|
64
67
|
*/
|
|
65
|
-
declare const TanStackRouterCodeSplitterWebpack: (options?:
|
|
66
|
-
target: "react" | "solid" | "vue";
|
|
67
|
-
routeFileIgnorePrefix: string;
|
|
68
|
-
routesDirectory: string;
|
|
69
|
-
quoteStyle: "single" | "double";
|
|
70
|
-
semicolons: boolean;
|
|
71
|
-
disableLogging: boolean;
|
|
72
|
-
routeTreeFileHeader: string[];
|
|
73
|
-
indexToken: string | RegExp | {
|
|
74
|
-
regex: string;
|
|
75
|
-
flags?: string | undefined;
|
|
76
|
-
};
|
|
77
|
-
routeToken: string | RegExp | {
|
|
78
|
-
regex: string;
|
|
79
|
-
flags?: string | undefined;
|
|
80
|
-
};
|
|
81
|
-
generatedRouteTree: string;
|
|
82
|
-
disableTypes: boolean;
|
|
83
|
-
addExtensions: string | boolean;
|
|
84
|
-
enableRouteTreeFormatting: boolean;
|
|
85
|
-
tmpDir: string;
|
|
86
|
-
importRoutesUsingAbsolutePaths: boolean;
|
|
87
|
-
enableRouteGeneration?: boolean | undefined;
|
|
88
|
-
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
89
|
-
plugin?: {
|
|
90
|
-
vite?: {
|
|
91
|
-
environmentName?: string | undefined;
|
|
92
|
-
} | undefined;
|
|
93
|
-
} | undefined;
|
|
94
|
-
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
95
|
-
routeFilePrefix?: string | undefined;
|
|
96
|
-
routeFileIgnorePattern?: string | undefined;
|
|
97
|
-
pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
|
|
98
|
-
verboseFileRoutes?: boolean | undefined;
|
|
99
|
-
routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
|
|
100
|
-
autoCodeSplitting?: boolean | undefined;
|
|
101
|
-
customScaffolding?: {
|
|
102
|
-
routeTemplate?: string | undefined;
|
|
103
|
-
lazyRouteTemplate?: string | undefined;
|
|
104
|
-
} | undefined;
|
|
105
|
-
experimental?: {
|
|
106
|
-
enableCodeSplitting?: boolean | undefined;
|
|
107
|
-
} | undefined;
|
|
108
|
-
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
109
|
-
} | (() => Config)> | undefined) => import('unplugin').WebpackPluginInstance;
|
|
68
|
+
declare const TanStackRouterCodeSplitterWebpack: (options?: unknown) => import('unplugin').WebpackPluginInstance;
|
|
110
69
|
/**
|
|
111
70
|
* @example
|
|
112
71
|
* ```ts
|
|
@@ -116,96 +75,8 @@ declare const TanStackRouterCodeSplitterWebpack: (options?: Partial<{
|
|
|
116
75
|
* }
|
|
117
76
|
* ```
|
|
118
77
|
*/
|
|
119
|
-
declare const TanStackRouterWebpack: (options?:
|
|
120
|
-
|
|
121
|
-
routeFileIgnorePrefix: string;
|
|
122
|
-
routesDirectory: string;
|
|
123
|
-
quoteStyle: "single" | "double";
|
|
124
|
-
semicolons: boolean;
|
|
125
|
-
disableLogging: boolean;
|
|
126
|
-
routeTreeFileHeader: string[];
|
|
127
|
-
indexToken: string | RegExp | {
|
|
128
|
-
regex: string;
|
|
129
|
-
flags?: string | undefined;
|
|
130
|
-
};
|
|
131
|
-
routeToken: string | RegExp | {
|
|
132
|
-
regex: string;
|
|
133
|
-
flags?: string | undefined;
|
|
134
|
-
};
|
|
135
|
-
generatedRouteTree: string;
|
|
136
|
-
disableTypes: boolean;
|
|
137
|
-
addExtensions: string | boolean;
|
|
138
|
-
enableRouteTreeFormatting: boolean;
|
|
139
|
-
tmpDir: string;
|
|
140
|
-
importRoutesUsingAbsolutePaths: boolean;
|
|
141
|
-
enableRouteGeneration?: boolean | undefined;
|
|
142
|
-
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
143
|
-
plugin?: {
|
|
144
|
-
vite?: {
|
|
145
|
-
environmentName?: string | undefined;
|
|
146
|
-
} | undefined;
|
|
147
|
-
} | undefined;
|
|
148
|
-
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
149
|
-
routeFilePrefix?: string | undefined;
|
|
150
|
-
routeFileIgnorePattern?: string | undefined;
|
|
151
|
-
pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
|
|
152
|
-
verboseFileRoutes?: boolean | undefined;
|
|
153
|
-
routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
|
|
154
|
-
autoCodeSplitting?: boolean | undefined;
|
|
155
|
-
customScaffolding?: {
|
|
156
|
-
routeTemplate?: string | undefined;
|
|
157
|
-
lazyRouteTemplate?: string | undefined;
|
|
158
|
-
} | undefined;
|
|
159
|
-
experimental?: {
|
|
160
|
-
enableCodeSplitting?: boolean | undefined;
|
|
161
|
-
} | undefined;
|
|
162
|
-
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
163
|
-
}> | undefined) => import('unplugin').WebpackPluginInstance;
|
|
164
|
-
declare const tanstackRouter: (options?: Partial<{
|
|
165
|
-
target: "react" | "solid" | "vue";
|
|
166
|
-
routeFileIgnorePrefix: string;
|
|
167
|
-
routesDirectory: string;
|
|
168
|
-
quoteStyle: "single" | "double";
|
|
169
|
-
semicolons: boolean;
|
|
170
|
-
disableLogging: boolean;
|
|
171
|
-
routeTreeFileHeader: string[];
|
|
172
|
-
indexToken: string | RegExp | {
|
|
173
|
-
regex: string;
|
|
174
|
-
flags?: string | undefined;
|
|
175
|
-
};
|
|
176
|
-
routeToken: string | RegExp | {
|
|
177
|
-
regex: string;
|
|
178
|
-
flags?: string | undefined;
|
|
179
|
-
};
|
|
180
|
-
generatedRouteTree: string;
|
|
181
|
-
disableTypes: boolean;
|
|
182
|
-
addExtensions: string | boolean;
|
|
183
|
-
enableRouteTreeFormatting: boolean;
|
|
184
|
-
tmpDir: string;
|
|
185
|
-
importRoutesUsingAbsolutePaths: boolean;
|
|
186
|
-
enableRouteGeneration?: boolean | undefined;
|
|
187
|
-
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
188
|
-
plugin?: {
|
|
189
|
-
vite?: {
|
|
190
|
-
environmentName?: string | undefined;
|
|
191
|
-
} | undefined;
|
|
192
|
-
} | undefined;
|
|
193
|
-
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
194
|
-
routeFilePrefix?: string | undefined;
|
|
195
|
-
routeFileIgnorePattern?: string | undefined;
|
|
196
|
-
pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
|
|
197
|
-
verboseFileRoutes?: boolean | undefined;
|
|
198
|
-
routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
|
|
199
|
-
autoCodeSplitting?: boolean | undefined;
|
|
200
|
-
customScaffolding?: {
|
|
201
|
-
routeTemplate?: string | undefined;
|
|
202
|
-
lazyRouteTemplate?: string | undefined;
|
|
203
|
-
} | undefined;
|
|
204
|
-
experimental?: {
|
|
205
|
-
enableCodeSplitting?: boolean | undefined;
|
|
206
|
-
} | undefined;
|
|
207
|
-
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
208
|
-
}> | undefined) => import('unplugin').WebpackPluginInstance;
|
|
78
|
+
declare const TanStackRouterWebpack: (options?: unknown) => import('unplugin').WebpackPluginInstance;
|
|
79
|
+
declare const tanstackRouter: (options?: unknown) => import('unplugin').WebpackPluginInstance;
|
|
209
80
|
export default TanStackRouterWebpack;
|
|
210
81
|
export { configSchema, TanStackRouterWebpack, TanStackRouterGeneratorWebpack, TanStackRouterCodeSplitterWebpack, tanstackRouter, };
|
|
211
82
|
export type { Config, CodeSplittingOptions };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ReferenceRouteCompilerPlugin } from './plugins.js';
|
|
1
|
+
import { CompileCodeSplitReferenceRouteOptions, ReferenceRouteCompilerPlugin } from './plugins.js';
|
|
2
2
|
import { GeneratorResult, ParseAstOptions } from '@tanstack/router-utils';
|
|
3
3
|
import { CodeSplitGroupings, SplitRouteIdentNodes } from '../constants.js';
|
|
4
|
-
import { Config, DeletableNodes } from '../config.js';
|
|
5
4
|
import * as t from '@babel/types';
|
|
6
5
|
export declare function addSharedSearchParamToFilename(filename: string): string;
|
|
7
6
|
/**
|
|
@@ -73,14 +72,7 @@ export declare function removeBindingsDependingOnRoute(shared: Set<string>, depG
|
|
|
73
72
|
* Pure node inspection of program.body, no traversal.
|
|
74
73
|
*/
|
|
75
74
|
export declare function expandDestructuredDeclarations(ast: t.File, shared: Set<string>): void;
|
|
76
|
-
export declare function compileCodeSplitReferenceRoute(opts: ParseAstOptions & {
|
|
77
|
-
codeSplitGroupings: CodeSplitGroupings;
|
|
78
|
-
deleteNodes?: Set<DeletableNodes>;
|
|
79
|
-
targetFramework: Config['target'];
|
|
80
|
-
filename: string;
|
|
81
|
-
id: string;
|
|
82
|
-
addHmr?: boolean;
|
|
83
|
-
sharedBindings?: Set<string>;
|
|
75
|
+
export declare function compileCodeSplitReferenceRoute(opts: ParseAstOptions & CompileCodeSplitReferenceRouteOptions & {
|
|
84
76
|
compilerPlugins?: Array<ReferenceRouteCompilerPlugin>;
|
|
85
77
|
}): GeneratorResult | null;
|
|
86
78
|
export declare function compileCodeSplitVirtualRoute(opts: ParseAstOptions & {
|
|
@@ -4,9 +4,9 @@ import { getObjectPropertyKeyName } from "../utils.js";
|
|
|
4
4
|
import { createIdentifier } from "./path-ids.js";
|
|
5
5
|
import { getFrameworkOptions } from "./framework-options.js";
|
|
6
6
|
import { deadCodeElimination, findReferencedIdentifiers, generateFromAst, parseAst } from "@tanstack/router-utils";
|
|
7
|
+
import * as template from "@babel/template";
|
|
7
8
|
import * as t from "@babel/types";
|
|
8
9
|
import * as babel from "@babel/core";
|
|
9
|
-
import * as template from "@babel/template";
|
|
10
10
|
//#region src/core/code-splitter/compilers.ts
|
|
11
11
|
var SPLIT_NODES_CONFIG = new Map([
|
|
12
12
|
["loader", {
|
|
@@ -398,7 +398,7 @@ function compileCodeSplitReferenceRoute(opts) {
|
|
|
398
398
|
opts
|
|
399
399
|
}))?.modified) modified = true;
|
|
400
400
|
});
|
|
401
|
-
programPath.pushContainer("body", createRouteHmrStatement(stableRouteOptionKeys));
|
|
401
|
+
programPath.pushContainer("body", createRouteHmrStatement(stableRouteOptionKeys, { hotExpression: opts.hmrHotExpression }));
|
|
402
402
|
modified = true;
|
|
403
403
|
hmrAdded = true;
|
|
404
404
|
};
|
|
@@ -464,7 +464,8 @@ function compileCodeSplitReferenceRoute(opts) {
|
|
|
464
464
|
routeOptions,
|
|
465
465
|
prop,
|
|
466
466
|
splitNodeMeta,
|
|
467
|
-
lazyRouteComponentIdent: LAZY_ROUTE_COMPONENT_IDENT
|
|
467
|
+
lazyRouteComponentIdent: LAZY_ROUTE_COMPONENT_IDENT,
|
|
468
|
+
opts
|
|
468
469
|
});
|
|
469
470
|
if (!pluginPropValue) continue;
|
|
470
471
|
modified = true;
|