@lovable.dev/vite-tanstack-config 1.7.0 → 2.0.0-rc.0

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/index.cjs CHANGED
@@ -266,7 +266,7 @@ function defineConfig(configOrOptions = {}) {
266
266
  options = { vite: await configOrOptions };
267
267
  } else {
268
268
  const optionObject = configOrOptions && typeof configOrOptions === "object" ? configOrOptions : {};
269
- const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "cloudflare" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
269
+ const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "nitro" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
270
270
  options = hasLovableKey ? optionObject : { vite: optionObject };
271
271
  }
272
272
  const internalPlugins = [];
@@ -280,16 +280,6 @@ function defineConfig(configOrOptions = {}) {
280
280
  if (options.ssrErrorLogger !== false) {
281
281
  internalPlugins.push(devSsrErrorLogger());
282
282
  }
283
- if (options.cloudflare !== false && command === "build") {
284
- try {
285
- const { cloudflare } = await import("@cloudflare/vite-plugin");
286
- const cfOptions = typeof options.cloudflare === "object" && options.cloudflare || {
287
- viteEnvironment: { name: "ssr" }
288
- };
289
- internalPlugins.push(cloudflare(cfOptions));
290
- } catch {
291
- }
292
- }
293
283
  const { tanstackStart } = await import("@tanstack/react-start/plugin/vite");
294
284
  const tanstackStartDefaults = {
295
285
  importProtection: {
@@ -302,6 +292,17 @@ function defineConfig(configOrOptions = {}) {
302
292
  };
303
293
  const tanstackStartOptions = (0, import_vite.mergeConfig)(tanstackStartDefaults, options.tanstackStart ?? {});
304
294
  internalPlugins.push(tanstackStart(tanstackStartOptions));
295
+ if (options.nitro !== false && command === "build") {
296
+ try {
297
+ const { nitro } = await import("nitro/vite");
298
+ const userNitroOpts = typeof options.nitro === "object" && options.nitro ? options.nitro : {};
299
+ const preset = userNitroOpts.preset ?? process.env.NITRO_PRESET ?? "cloudflare-module";
300
+ const userOutput = typeof userNitroOpts.output === "object" && userNitroOpts.output ? userNitroOpts.output : {};
301
+ const output = { dir: "dist", ...userOutput };
302
+ internalPlugins.push(nitro({ config: { ...userNitroOpts, preset, output } }));
303
+ } catch {
304
+ }
305
+ }
305
306
  const viteReact = (await import("@vitejs/plugin-react")).default;
306
307
  internalPlugins.push(viteReact(options.react));
307
308
  if (command === "serve") {
package/dist/index.d.cts CHANGED
@@ -5,7 +5,13 @@ interface LovableViteTanstackOptions {
5
5
  vite?: UserConfig;
6
6
  serverFnErrorLogger?: boolean;
7
7
  ssrErrorLogger?: boolean;
8
- cloudflare?: Record<string, unknown> | false;
8
+ /**
9
+ * Options forwarded to `nitro()` from `nitro/vite`. Set to `false` to skip
10
+ * the Nitro build plugin entirely (e.g. when the surrounding tanstackStart
11
+ * version already delegates to Nitro internally). The deploy preset is
12
+ * selected via `NITRO_PRESET` env var or `nitro.preset` here.
13
+ */
14
+ nitro?: Record<string, unknown> | false;
9
15
  /** Options forwarded to tanstackStart(). */
10
16
  tanstackStart?: Record<string, unknown>;
11
17
  /** Options forwarded to viteReact(). */
package/dist/index.d.ts CHANGED
@@ -5,7 +5,13 @@ interface LovableViteTanstackOptions {
5
5
  vite?: UserConfig;
6
6
  serverFnErrorLogger?: boolean;
7
7
  ssrErrorLogger?: boolean;
8
- cloudflare?: Record<string, unknown> | false;
8
+ /**
9
+ * Options forwarded to `nitro()` from `nitro/vite`. Set to `false` to skip
10
+ * the Nitro build plugin entirely (e.g. when the surrounding tanstackStart
11
+ * version already delegates to Nitro internally). The deploy preset is
12
+ * selected via `NITRO_PRESET` env var or `nitro.preset` here.
13
+ */
14
+ nitro?: Record<string, unknown> | false;
9
15
  /** Options forwarded to tanstackStart(). */
10
16
  tanstackStart?: Record<string, unknown>;
11
17
  /** Options forwarded to viteReact(). */
package/dist/index.js CHANGED
@@ -232,7 +232,7 @@ function defineConfig(configOrOptions = {}) {
232
232
  options = { vite: await configOrOptions };
233
233
  } else {
234
234
  const optionObject = configOrOptions && typeof configOrOptions === "object" ? configOrOptions : {};
235
- const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "cloudflare" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
235
+ const hasLovableKey = "vite" in optionObject || "serverFnErrorLogger" in optionObject || "ssrErrorLogger" in optionObject || "nitro" in optionObject || "tanstackStart" in optionObject || "react" in optionObject || "envDefine" in optionObject || "hmrGate" in optionObject;
236
236
  options = hasLovableKey ? optionObject : { vite: optionObject };
237
237
  }
238
238
  const internalPlugins = [];
@@ -246,16 +246,6 @@ function defineConfig(configOrOptions = {}) {
246
246
  if (options.ssrErrorLogger !== false) {
247
247
  internalPlugins.push(devSsrErrorLogger());
248
248
  }
249
- if (options.cloudflare !== false && command === "build") {
250
- try {
251
- const { cloudflare } = await import("@cloudflare/vite-plugin");
252
- const cfOptions = typeof options.cloudflare === "object" && options.cloudflare || {
253
- viteEnvironment: { name: "ssr" }
254
- };
255
- internalPlugins.push(cloudflare(cfOptions));
256
- } catch {
257
- }
258
- }
259
249
  const { tanstackStart } = await import("@tanstack/react-start/plugin/vite");
260
250
  const tanstackStartDefaults = {
261
251
  importProtection: {
@@ -268,6 +258,17 @@ function defineConfig(configOrOptions = {}) {
268
258
  };
269
259
  const tanstackStartOptions = mergeConfig(tanstackStartDefaults, options.tanstackStart ?? {});
270
260
  internalPlugins.push(tanstackStart(tanstackStartOptions));
261
+ if (options.nitro !== false && command === "build") {
262
+ try {
263
+ const { nitro } = await import("nitro/vite");
264
+ const userNitroOpts = typeof options.nitro === "object" && options.nitro ? options.nitro : {};
265
+ const preset = userNitroOpts.preset ?? process.env.NITRO_PRESET ?? "cloudflare-module";
266
+ const userOutput = typeof userNitroOpts.output === "object" && userNitroOpts.output ? userNitroOpts.output : {};
267
+ const output = { dir: "dist", ...userOutput };
268
+ internalPlugins.push(nitro({ config: { ...userNitroOpts, preset, output } }));
269
+ } catch {
270
+ }
271
+ }
271
272
  const viteReact = (await import("@vitejs/plugin-react")).default;
272
273
  internalPlugins.push(viteReact(options.react));
273
274
  if (command === "serve") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/vite-tanstack-config",
3
- "version": "1.7.0",
3
+ "version": "2.0.0-rc.0",
4
4
  "description": "Vite config wrapper for Lovable TanStack Start projects",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -9,15 +9,6 @@
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
- "scripts": {
13
- "build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
14
- "typecheck": "tsgo --noEmit",
15
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
16
- "test": "vitest",
17
- "prepublishOnly": "npm run clean && npm run build",
18
- "clean": "rimraf dist",
19
- "coverage": "vitest run --coverage"
20
- },
21
12
  "keywords": [
22
13
  "vite",
23
14
  "tanstack",
@@ -34,26 +25,34 @@
34
25
  "vite": ">=5.0.0 <9.0.0",
35
26
  "@tailwindcss/vite": ">=4.0.0",
36
27
  "vite-tsconfig-paths": ">=6.0.0",
37
- "@cloudflare/vite-plugin": ">=1.0.0",
28
+ "nitro": "^3.0.0",
38
29
  "@tanstack/react-start": ">=1.100.0",
39
30
  "@vitejs/plugin-react": ">=4.0.0"
40
31
  },
41
32
  "peerDependenciesMeta": {
42
- "@cloudflare/vite-plugin": {
33
+ "nitro": {
43
34
  "optional": true
44
35
  }
45
36
  },
46
37
  "devDependencies": {
47
- "@cloudflare/vite-plugin": "^1.25.5",
38
+ "nitro": "3.0.0",
48
39
  "@tanstack/react-start": "^1.162.9",
49
40
  "@vitejs/plugin-react": "^4.5.2",
50
41
  "@tailwindcss/vite": "^4.2.1",
51
- "@types/node": "catalog:",
42
+ "@types/node": "22.13.13",
52
43
  "rimraf": "^5.0.0",
53
44
  "tsup": "^7.2.0",
54
- "typescript": "catalog:",
45
+ "typescript": "^5.9.3",
55
46
  "vite": "^7.3.1",
56
47
  "vite-tsconfig-paths": "^6.0.2",
57
- "vitest": "catalog:"
48
+ "vitest": "^4.1.5"
49
+ },
50
+ "scripts": {
51
+ "build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
52
+ "typecheck": "tsgo --noEmit",
53
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
54
+ "test": "vitest",
55
+ "clean": "rimraf dist",
56
+ "coverage": "vitest run --coverage"
58
57
  }
59
- }
58
+ }