@lovable.dev/vite-tanstack-config 2.1.0 → 2.1.1

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
@@ -312,8 +312,19 @@ function defineConfig(configOrOptions = {}) {
312
312
  );
313
313
  }
314
314
  if (shouldRunNitro) {
315
+ let nitroMod;
315
316
  try {
316
- const { nitro } = await import("nitro/vite");
317
+ nitroMod = await import("nitro/vite");
318
+ } catch (err) {
319
+ if (explicitNitro || isSandbox) {
320
+ const reason = explicitNitro ? `an explicit \`nitro\` option (${options.nitro === true ? "true" : "{ ... }"}) was set in vite.config.ts` : "running inside a Lovable sandbox";
321
+ throw new Error(
322
+ `[@lovable.dev/vite-tanstack-config] ${reason}, but the \`nitro\` package isn't installed. Add \`nitro\` to your devDependencies (matches peerDependency >=3.0.260429-beta). Original import error: ${err instanceof Error ? err.message : String(err)}`
323
+ );
324
+ }
325
+ }
326
+ if (nitroMod) {
327
+ const { nitro } = nitroMod;
317
328
  const userNitroOpts = typeof options.nitro === "object" && options.nitro ? options.nitro : {};
318
329
  const preset = userNitroOpts.preset ?? process.env.NITRO_PRESET ?? "cloudflare-module";
319
330
  const output = {
@@ -327,7 +338,6 @@ function defineConfig(configOrOptions = {}) {
327
338
  nitroOpts.cloudflare = { nodeCompat: true, deployConfig: true, ...userNitroOpts.cloudflare };
328
339
  }
329
340
  internalPlugins.push(nitro(nitroOpts));
330
- } catch {
331
341
  }
332
342
  }
333
343
  const viteReact = (await import("@vitejs/plugin-react")).default;
package/dist/index.js CHANGED
@@ -278,8 +278,19 @@ function defineConfig(configOrOptions = {}) {
278
278
  );
279
279
  }
280
280
  if (shouldRunNitro) {
281
+ let nitroMod;
281
282
  try {
282
- const { nitro } = await import("nitro/vite");
283
+ nitroMod = await import("nitro/vite");
284
+ } catch (err) {
285
+ if (explicitNitro || isSandbox) {
286
+ const reason = explicitNitro ? `an explicit \`nitro\` option (${options.nitro === true ? "true" : "{ ... }"}) was set in vite.config.ts` : "running inside a Lovable sandbox";
287
+ throw new Error(
288
+ `[@lovable.dev/vite-tanstack-config] ${reason}, but the \`nitro\` package isn't installed. Add \`nitro\` to your devDependencies (matches peerDependency >=3.0.260429-beta). Original import error: ${err instanceof Error ? err.message : String(err)}`
289
+ );
290
+ }
291
+ }
292
+ if (nitroMod) {
293
+ const { nitro } = nitroMod;
283
294
  const userNitroOpts = typeof options.nitro === "object" && options.nitro ? options.nitro : {};
284
295
  const preset = userNitroOpts.preset ?? process.env.NITRO_PRESET ?? "cloudflare-module";
285
296
  const output = {
@@ -293,7 +304,6 @@ function defineConfig(configOrOptions = {}) {
293
304
  nitroOpts.cloudflare = { nodeCompat: true, deployConfig: true, ...userNitroOpts.cloudflare };
294
305
  }
295
306
  internalPlugins.push(nitro(nitroOpts));
296
- } catch {
297
307
  }
298
308
  }
299
309
  const viteReact = (await import("@vitejs/plugin-react")).default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/vite-tanstack-config",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Vite config wrapper for Lovable TanStack Start projects",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",