@tanstack/router-plugin 1.121.0-alpha.2 → 1.121.0-alpha.26
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/config.cjs.map +1 -1
- package/dist/cjs/core/config.d.cts +10 -4
- package/dist/cjs/core/route-hmr-statement.cjs +1 -1
- package/dist/cjs/core/route-hmr-statement.cjs.map +1 -1
- package/dist/cjs/core/router-generator-plugin.cjs +35 -47
- package/dist/cjs/core/router-generator-plugin.cjs.map +1 -1
- package/dist/cjs/esbuild.d.cts +8 -4
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/rspack.d.cts +8 -4
- package/dist/cjs/vite.cjs +11 -8
- package/dist/cjs/vite.cjs.map +1 -1
- package/dist/cjs/vite.d.cts +53 -13
- package/dist/cjs/webpack.d.cts +8 -4
- package/dist/esm/core/config.d.ts +10 -4
- package/dist/esm/core/config.js.map +1 -1
- package/dist/esm/core/route-hmr-statement.js +1 -1
- package/dist/esm/core/route-hmr-statement.js.map +1 -1
- package/dist/esm/core/router-generator-plugin.js +37 -49
- package/dist/esm/core/router-generator-plugin.js.map +1 -1
- package/dist/esm/esbuild.d.ts +8 -4
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/rspack.d.ts +8 -4
- package/dist/esm/vite.d.ts +53 -13
- package/dist/esm/vite.js +12 -9
- package/dist/esm/vite.js.map +1 -1
- package/dist/esm/webpack.d.ts +8 -4
- package/package.json +10 -8
- package/src/core/config.ts +2 -0
- package/src/core/route-hmr-statement.ts +1 -1
- package/src/core/router-generator-plugin.ts +39 -63
- package/src/index.ts +2 -2
- package/src/vite.ts +20 -13
package/src/vite.ts
CHANGED
|
@@ -4,32 +4,34 @@ import { configSchema } from './core/config'
|
|
|
4
4
|
import { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin'
|
|
5
5
|
import { unpluginRouterGeneratorFactory } from './core/router-generator-plugin'
|
|
6
6
|
import { unpluginRouterComposedFactory } from './core/router-composed-plugin'
|
|
7
|
-
|
|
7
|
+
import { unpluginRouteAutoImportFactory } from './core/route-autoimport-plugin'
|
|
8
8
|
import type { Config } from './core/config'
|
|
9
9
|
|
|
10
|
+
const tanstackRouterAutoImport = createVitePlugin(
|
|
11
|
+
unpluginRouteAutoImportFactory,
|
|
12
|
+
)
|
|
13
|
+
|
|
10
14
|
/**
|
|
11
15
|
* @example
|
|
12
16
|
* ```ts
|
|
13
17
|
* export default defineConfig({
|
|
14
|
-
* plugins: [
|
|
18
|
+
* plugins: [tanstackRouterGenerator()],
|
|
15
19
|
* // ...
|
|
16
20
|
* })
|
|
17
21
|
* ```
|
|
18
22
|
*/
|
|
19
|
-
const
|
|
20
|
-
unpluginRouterGeneratorFactory,
|
|
21
|
-
)
|
|
23
|
+
const tanstackRouterGenerator = createVitePlugin(unpluginRouterGeneratorFactory)
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
28
|
* export default defineConfig({
|
|
27
|
-
* plugins: [
|
|
29
|
+
* plugins: [tanStackRouterCodeSplitter()],
|
|
28
30
|
* // ...
|
|
29
31
|
* })
|
|
30
32
|
* ```
|
|
31
33
|
*/
|
|
32
|
-
const
|
|
34
|
+
const tanStackRouterCodeSplitter = createVitePlugin(
|
|
33
35
|
unpluginRouterCodeSplitterFactory,
|
|
34
36
|
)
|
|
35
37
|
|
|
@@ -37,19 +39,24 @@ const TanStackRouterCodeSplitterVite = createVitePlugin(
|
|
|
37
39
|
* @example
|
|
38
40
|
* ```ts
|
|
39
41
|
* export default defineConfig({
|
|
40
|
-
* plugins: [
|
|
42
|
+
* plugins: [tanstackRouter()],
|
|
41
43
|
* // ...
|
|
42
44
|
* })
|
|
43
45
|
* ```
|
|
44
46
|
*/
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
+
const tanstackRouter = createVitePlugin(unpluginRouterComposedFactory)
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use `tanstackRouter` instead.
|
|
51
|
+
*/
|
|
52
|
+
const TanStackRouterVite = tanstackRouter
|
|
47
53
|
|
|
48
|
-
export default
|
|
54
|
+
export default tanstackRouter
|
|
49
55
|
export {
|
|
50
56
|
configSchema,
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
tanstackRouterAutoImport,
|
|
58
|
+
tanStackRouterCodeSplitter,
|
|
59
|
+
tanstackRouterGenerator,
|
|
53
60
|
TanStackRouterVite,
|
|
54
61
|
tanstackRouter,
|
|
55
62
|
}
|