@tanstack/router-vite-plugin 1.20.0 → 1.20.5
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/index.cjs +2 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const path = require("path");
|
|
|
4
4
|
const routerGenerator = require("@tanstack/router-generator");
|
|
5
5
|
const CONFIG_FILE_NAME = "tsr.config.json";
|
|
6
6
|
function TanStackRouterVite(inlineConfig = {}) {
|
|
7
|
-
|
|
7
|
+
const ROOT = process.cwd();
|
|
8
8
|
let userConfig;
|
|
9
9
|
const generate = async () => {
|
|
10
10
|
try {
|
|
@@ -16,8 +16,7 @@ function TanStackRouterVite(inlineConfig = {}) {
|
|
|
16
16
|
};
|
|
17
17
|
return {
|
|
18
18
|
name: "vite-plugin-tanstack-router",
|
|
19
|
-
configResolved: async (
|
|
20
|
-
ROOT = vite.root;
|
|
19
|
+
configResolved: async () => {
|
|
21
20
|
userConfig = await routerGenerator.getConfig(inlineConfig, ROOT);
|
|
22
21
|
await generate();
|
|
23
22
|
},
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import { Plugin } from 'vite'\nimport { join, normalize, isAbsolute } from 'path'\nimport { type Config, getConfig, generator } from '@tanstack/router-generator'\n\nconst CONFIG_FILE_NAME = 'tsr.config.json'\n\nexport function TanStackRouterVite(inlineConfig: Partial<Config> = {}): Plugin {\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import { Plugin } from 'vite'\nimport { join, normalize, isAbsolute } from 'path'\nimport { type Config, getConfig, generator } from '@tanstack/router-generator'\n\nconst CONFIG_FILE_NAME = 'tsr.config.json'\n\nexport function TanStackRouterVite(inlineConfig: Partial<Config> = {}): Plugin {\n const ROOT: string = process.cwd()\n let userConfig: Config\n\n const generate = async () => {\n try {\n await generator(userConfig)\n } catch (err) {\n console.error(err)\n console.info()\n }\n }\n\n return {\n name: 'vite-plugin-tanstack-router',\n configResolved: async () => {\n userConfig = await getConfig(inlineConfig, ROOT)\n await generate()\n },\n handleHotUpdate: async ({ file }) => {\n const filePath = normalize(file)\n if (filePath === join(ROOT, CONFIG_FILE_NAME)) {\n userConfig = await getConfig(inlineConfig, ROOT)\n return\n }\n const routesDirectoryPath = isAbsolute(userConfig.routesDirectory)\n ? userConfig.routesDirectory\n : join(ROOT, userConfig.routesDirectory)\n if (filePath.startsWith(routesDirectoryPath)) {\n await generate()\n }\n },\n }\n}\n"],"names":["generator","getConfig","normalize","join","isAbsolute"],"mappings":";;;;AAIA,MAAM,mBAAmB;AAET,SAAA,mBAAmB,eAAgC,IAAY;AACvE,QAAA,OAAe,QAAQ;AACzB,MAAA;AAEJ,QAAM,WAAW,YAAY;AACvB,QAAA;AACF,YAAMA,gBAAAA,UAAU,UAAU;AAAA,aACnB,KAAK;AACZ,cAAQ,MAAM,GAAG;AACjB,cAAQ,KAAK;AAAA,IACf;AAAA,EAAA;AAGK,SAAA;AAAA,IACL,MAAM;AAAA,IACN,gBAAgB,YAAY;AACb,mBAAA,MAAMC,gBAAAA,UAAU,cAAc,IAAI;AAC/C,YAAM,SAAS;AAAA,IACjB;AAAA,IACA,iBAAiB,OAAO,EAAE,WAAW;AAC7B,YAAA,WAAWC,eAAU,IAAI;AAC/B,UAAI,aAAaC,KAAAA,KAAK,MAAM,gBAAgB,GAAG;AAChC,qBAAA,MAAMF,gBAAAA,UAAU,cAAc,IAAI;AAC/C;AAAA,MACF;AACM,YAAA,sBAAsBG,KAAAA,WAAW,WAAW,eAAe,IAC7D,WAAW,kBACXD,UAAK,MAAM,WAAW,eAAe;AACrC,UAAA,SAAS,WAAW,mBAAmB,GAAG;AAC5C,cAAM,SAAS;AAAA,MACjB;AAAA,IACF;AAAA,EAAA;AAEJ;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { normalize, join, isAbsolute } from "path";
|
|
|
2
2
|
import { getConfig, generator } from "@tanstack/router-generator";
|
|
3
3
|
const CONFIG_FILE_NAME = "tsr.config.json";
|
|
4
4
|
function TanStackRouterVite(inlineConfig = {}) {
|
|
5
|
-
|
|
5
|
+
const ROOT = process.cwd();
|
|
6
6
|
let userConfig;
|
|
7
7
|
const generate = async () => {
|
|
8
8
|
try {
|
|
@@ -14,8 +14,7 @@ function TanStackRouterVite(inlineConfig = {}) {
|
|
|
14
14
|
};
|
|
15
15
|
return {
|
|
16
16
|
name: "vite-plugin-tanstack-router",
|
|
17
|
-
configResolved: async (
|
|
18
|
-
ROOT = vite.root;
|
|
17
|
+
configResolved: async () => {
|
|
19
18
|
userConfig = await getConfig(inlineConfig, ROOT);
|
|
20
19
|
await generate();
|
|
21
20
|
},
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { Plugin } from 'vite'\nimport { join, normalize, isAbsolute } from 'path'\nimport { type Config, getConfig, generator } from '@tanstack/router-generator'\n\nconst CONFIG_FILE_NAME = 'tsr.config.json'\n\nexport function TanStackRouterVite(inlineConfig: Partial<Config> = {}): Plugin {\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { Plugin } from 'vite'\nimport { join, normalize, isAbsolute } from 'path'\nimport { type Config, getConfig, generator } from '@tanstack/router-generator'\n\nconst CONFIG_FILE_NAME = 'tsr.config.json'\n\nexport function TanStackRouterVite(inlineConfig: Partial<Config> = {}): Plugin {\n const ROOT: string = process.cwd()\n let userConfig: Config\n\n const generate = async () => {\n try {\n await generator(userConfig)\n } catch (err) {\n console.error(err)\n console.info()\n }\n }\n\n return {\n name: 'vite-plugin-tanstack-router',\n configResolved: async () => {\n userConfig = await getConfig(inlineConfig, ROOT)\n await generate()\n },\n handleHotUpdate: async ({ file }) => {\n const filePath = normalize(file)\n if (filePath === join(ROOT, CONFIG_FILE_NAME)) {\n userConfig = await getConfig(inlineConfig, ROOT)\n return\n }\n const routesDirectoryPath = isAbsolute(userConfig.routesDirectory)\n ? userConfig.routesDirectory\n : join(ROOT, userConfig.routesDirectory)\n if (filePath.startsWith(routesDirectoryPath)) {\n await generate()\n }\n },\n }\n}\n"],"names":[],"mappings":";;AAIA,MAAM,mBAAmB;AAET,SAAA,mBAAmB,eAAgC,IAAY;AACvE,QAAA,OAAe,QAAQ;AACzB,MAAA;AAEJ,QAAM,WAAW,YAAY;AACvB,QAAA;AACF,YAAM,UAAU,UAAU;AAAA,aACnB,KAAK;AACZ,cAAQ,MAAM,GAAG;AACjB,cAAQ,KAAK;AAAA,IACf;AAAA,EAAA;AAGK,SAAA;AAAA,IACL,MAAM;AAAA,IACN,gBAAgB,YAAY;AACb,mBAAA,MAAM,UAAU,cAAc,IAAI;AAC/C,YAAM,SAAS;AAAA,IACjB;AAAA,IACA,iBAAiB,OAAO,EAAE,WAAW;AAC7B,YAAA,WAAW,UAAU,IAAI;AAC/B,UAAI,aAAa,KAAK,MAAM,gBAAgB,GAAG;AAChC,qBAAA,MAAM,UAAU,cAAc,IAAI;AAC/C;AAAA,MACF;AACM,YAAA,sBAAsB,WAAW,WAAW,eAAe,IAC7D,WAAW,kBACX,KAAK,MAAM,WAAW,eAAe;AACrC,UAAA,SAAS,WAAW,mBAAmB,GAAG;AAC5C,cAAM,SAAS;AAAA,MACjB;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/router-vite-plugin",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"src/**"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@tanstack/router-generator": "1.20.
|
|
52
|
+
"@tanstack/router-generator": "1.20.5"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"clean": "rimraf ./dist && rimraf ./coverage",
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type Config, getConfig, generator } from '@tanstack/router-generator'
|
|
|
5
5
|
const CONFIG_FILE_NAME = 'tsr.config.json'
|
|
6
6
|
|
|
7
7
|
export function TanStackRouterVite(inlineConfig: Partial<Config> = {}): Plugin {
|
|
8
|
-
|
|
8
|
+
const ROOT: string = process.cwd()
|
|
9
9
|
let userConfig: Config
|
|
10
10
|
|
|
11
11
|
const generate = async () => {
|
|
@@ -19,8 +19,7 @@ export function TanStackRouterVite(inlineConfig: Partial<Config> = {}): Plugin {
|
|
|
19
19
|
|
|
20
20
|
return {
|
|
21
21
|
name: 'vite-plugin-tanstack-router',
|
|
22
|
-
configResolved: async (
|
|
23
|
-
ROOT = vite.root
|
|
22
|
+
configResolved: async () => {
|
|
24
23
|
userConfig = await getConfig(inlineConfig, ROOT)
|
|
25
24
|
await generate()
|
|
26
25
|
},
|