@lovable.dev/vite-tanstack-config 2.1.0 → 2.2.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 +18 -2
- package/dist/index.js +18 -2
- package/package.json +2 -1
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
|
-
|
|
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;
|
|
@@ -357,6 +367,12 @@ function defineConfig(configOrOptions = {}) {
|
|
|
357
367
|
}
|
|
358
368
|
let config = {
|
|
359
369
|
define: envDefine,
|
|
370
|
+
// Match the build's CSS pipeline in dev. Vite uses PostCSS in dev and only
|
|
371
|
+
// runs Lightning CSS at build, so build-time transforms (e.g. collapsing a
|
|
372
|
+
// hand-written `-webkit-backdrop-filter` to the prefixed form Chrome ignores)
|
|
373
|
+
// break the built/static output while the dev preview looks fine. Running
|
|
374
|
+
// Lightning CSS in both keeps the preview honest.
|
|
375
|
+
css: { transformer: "lightningcss" },
|
|
360
376
|
resolve: {
|
|
361
377
|
alias: {
|
|
362
378
|
"@": `${process.cwd()}/src`
|
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
|
-
|
|
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;
|
|
@@ -323,6 +333,12 @@ function defineConfig(configOrOptions = {}) {
|
|
|
323
333
|
}
|
|
324
334
|
let config = {
|
|
325
335
|
define: envDefine,
|
|
336
|
+
// Match the build's CSS pipeline in dev. Vite uses PostCSS in dev and only
|
|
337
|
+
// runs Lightning CSS at build, so build-time transforms (e.g. collapsing a
|
|
338
|
+
// hand-written `-webkit-backdrop-filter` to the prefixed form Chrome ignores)
|
|
339
|
+
// break the built/static output while the dev preview looks fine. Running
|
|
340
|
+
// Lightning CSS in both keeps the preview honest.
|
|
341
|
+
css: { transformer: "lightningcss" },
|
|
326
342
|
resolve: {
|
|
327
343
|
alias: {
|
|
328
344
|
"@": `${process.cwd()}/src`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovable.dev/vite-tanstack-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.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",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@lovable.dev/vite-plugin-dev-server-bridge": "^1.0.0",
|
|
30
30
|
"@lovable.dev/vite-plugin-hmr-gate": "^1.0.0",
|
|
31
|
+
"lightningcss": "^1.30.0",
|
|
31
32
|
"lovable-tagger": "1.2.0"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|