@lovable.dev/vite-tanstack-config 2.7.5 → 2.7.7
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 +591 -733
- package/dist/index.d.cts +56 -55
- package/dist/index.d.ts +56 -55
- package/dist/index.js +574 -705
- package/package.json +10 -9
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Plugin, PluginOption, UserConfig,
|
|
2
|
-
|
|
1
|
+
import { ConfigEnv, Plugin, PluginOption, UserConfig, UserConfigFn, UserConfigFnObject, UserConfigFnPromise } from "vite";
|
|
2
|
+
//#region src/assetsProxyPlugin.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Forwards `/__l5e/assets-v1/*` requests from the Vite dev server to the
|
|
5
5
|
* Lovable preview proxy so assets resolve when the page is loaded directly
|
|
@@ -10,58 +10,59 @@ import { Plugin, PluginOption, UserConfig, ConfigEnv, UserConfigFnObject, UserCo
|
|
|
10
10
|
* `id-preview--<project-id>.lovable.app`.
|
|
11
11
|
*/
|
|
12
12
|
declare function lovableAssetsProxyPlugin(): Plugin;
|
|
13
|
-
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/index.d.ts
|
|
14
15
|
interface LovableViteTanstackOptions {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
16
|
+
plugins?: PluginOption[];
|
|
17
|
+
vite?: UserConfig;
|
|
18
|
+
serverFnErrorLogger?: boolean;
|
|
19
|
+
ssrErrorLogger?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Options forwarded to `nitro()` from `nitro/vite`.
|
|
22
|
+
*
|
|
23
|
+
* Behavior:
|
|
24
|
+
* - **undefined** (default): nitro runs on every production build, defaulting
|
|
25
|
+
* to the `cloudflare-module` preset via Nitro's `defaultPreset` — zero-config
|
|
26
|
+
* target auto-detection (`NITRO_PRESET`, Vercel/Netlify/Cloudflare Pages)
|
|
27
|
+
* still wins, so a self-deploy auto-targets its own platform. If the optional
|
|
28
|
+
* `nitro` peer dep isn't installed, it's skipped (no deploy intent to honor).
|
|
29
|
+
* - **`true`**: same as undefined, but fails fast if the `nitro` peer dep is
|
|
30
|
+
* missing — the explicit opt-in signals deploy intent.
|
|
31
|
+
* - **object**: force-on, with these overrides. Set `preset`
|
|
32
|
+
* (e.g. `{ preset: "vercel" }`) to hard-pin a target from your own CI.
|
|
33
|
+
* - **`false`**: skip nitro entirely.
|
|
34
|
+
*
|
|
35
|
+
* Inside a Lovable build the preset and output layout are forced to
|
|
36
|
+
* Cloudflare; `preset`/`output`/`cloudflare` overrides apply only outside it.
|
|
37
|
+
*
|
|
38
|
+
* The option surface is narrow on purpose — Nitro v3 is still pre-RC, so
|
|
39
|
+
* we only expose stable build-time knobs to reduce churn if
|
|
40
|
+
* `NitroPluginConfig` schema changes. File an issue if you need more.
|
|
41
|
+
*/
|
|
42
|
+
nitro?: true | {
|
|
43
|
+
preset?: string;
|
|
44
|
+
output?: {
|
|
45
|
+
dir?: string;
|
|
46
|
+
publicDir?: string;
|
|
47
|
+
serverDir?: string;
|
|
48
|
+
};
|
|
49
|
+
cloudflare?: {
|
|
50
|
+
nodeCompat?: boolean;
|
|
51
|
+
deployConfig?: boolean;
|
|
52
|
+
};
|
|
53
|
+
} | false;
|
|
54
|
+
/** Options forwarded to tanstackStart(). */
|
|
55
|
+
tanstackStart?: Record<string, unknown>;
|
|
56
|
+
/** Options forwarded to viteReact(). */
|
|
57
|
+
react?: Record<string, unknown>;
|
|
58
|
+
/** Set to false to disable automatic VITE_* env define injection. Default: true. */
|
|
59
|
+
envDefine?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Options for the HMR gate plugin (@lovable.dev/vite-plugin-hmr-gate).
|
|
62
|
+
* Enabled by default in sandbox mode. Set to false to disable, or pass options
|
|
63
|
+
* to customise behaviour. Set to true or an options object to enable outside sandbox.
|
|
64
|
+
*/
|
|
65
|
+
hmrGate?: boolean | Record<string, unknown>;
|
|
65
66
|
}
|
|
66
67
|
declare function defineConfig(config: UserConfig): (env: ConfigEnv) => Promise<UserConfig>;
|
|
67
68
|
declare function defineConfig(config: Promise<UserConfig>): (env: ConfigEnv) => Promise<UserConfig>;
|
|
@@ -69,5 +70,5 @@ declare function defineConfig(config: UserConfigFnObject): (env: ConfigEnv) => P
|
|
|
69
70
|
declare function defineConfig(config: UserConfigFnPromise): (env: ConfigEnv) => Promise<UserConfig>;
|
|
70
71
|
declare function defineConfig(config: UserConfigFn): (env: ConfigEnv) => Promise<UserConfig>;
|
|
71
72
|
declare function defineConfig(options?: LovableViteTanstackOptions): (env: ConfigEnv) => Promise<UserConfig>;
|
|
72
|
-
|
|
73
|
-
export {
|
|
73
|
+
//#endregion
|
|
74
|
+
export { LovableViteTanstackOptions, defineConfig, lovableAssetsProxyPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Plugin, PluginOption, UserConfig,
|
|
2
|
-
|
|
1
|
+
import { ConfigEnv, Plugin, PluginOption, UserConfig, UserConfigFn, UserConfigFnObject, UserConfigFnPromise } from "vite";
|
|
2
|
+
//#region src/assetsProxyPlugin.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Forwards `/__l5e/assets-v1/*` requests from the Vite dev server to the
|
|
5
5
|
* Lovable preview proxy so assets resolve when the page is loaded directly
|
|
@@ -10,58 +10,59 @@ import { Plugin, PluginOption, UserConfig, ConfigEnv, UserConfigFnObject, UserCo
|
|
|
10
10
|
* `id-preview--<project-id>.lovable.app`.
|
|
11
11
|
*/
|
|
12
12
|
declare function lovableAssetsProxyPlugin(): Plugin;
|
|
13
|
-
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/index.d.ts
|
|
14
15
|
interface LovableViteTanstackOptions {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
16
|
+
plugins?: PluginOption[];
|
|
17
|
+
vite?: UserConfig;
|
|
18
|
+
serverFnErrorLogger?: boolean;
|
|
19
|
+
ssrErrorLogger?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Options forwarded to `nitro()` from `nitro/vite`.
|
|
22
|
+
*
|
|
23
|
+
* Behavior:
|
|
24
|
+
* - **undefined** (default): nitro runs on every production build, defaulting
|
|
25
|
+
* to the `cloudflare-module` preset via Nitro's `defaultPreset` — zero-config
|
|
26
|
+
* target auto-detection (`NITRO_PRESET`, Vercel/Netlify/Cloudflare Pages)
|
|
27
|
+
* still wins, so a self-deploy auto-targets its own platform. If the optional
|
|
28
|
+
* `nitro` peer dep isn't installed, it's skipped (no deploy intent to honor).
|
|
29
|
+
* - **`true`**: same as undefined, but fails fast if the `nitro` peer dep is
|
|
30
|
+
* missing — the explicit opt-in signals deploy intent.
|
|
31
|
+
* - **object**: force-on, with these overrides. Set `preset`
|
|
32
|
+
* (e.g. `{ preset: "vercel" }`) to hard-pin a target from your own CI.
|
|
33
|
+
* - **`false`**: skip nitro entirely.
|
|
34
|
+
*
|
|
35
|
+
* Inside a Lovable build the preset and output layout are forced to
|
|
36
|
+
* Cloudflare; `preset`/`output`/`cloudflare` overrides apply only outside it.
|
|
37
|
+
*
|
|
38
|
+
* The option surface is narrow on purpose — Nitro v3 is still pre-RC, so
|
|
39
|
+
* we only expose stable build-time knobs to reduce churn if
|
|
40
|
+
* `NitroPluginConfig` schema changes. File an issue if you need more.
|
|
41
|
+
*/
|
|
42
|
+
nitro?: true | {
|
|
43
|
+
preset?: string;
|
|
44
|
+
output?: {
|
|
45
|
+
dir?: string;
|
|
46
|
+
publicDir?: string;
|
|
47
|
+
serverDir?: string;
|
|
48
|
+
};
|
|
49
|
+
cloudflare?: {
|
|
50
|
+
nodeCompat?: boolean;
|
|
51
|
+
deployConfig?: boolean;
|
|
52
|
+
};
|
|
53
|
+
} | false;
|
|
54
|
+
/** Options forwarded to tanstackStart(). */
|
|
55
|
+
tanstackStart?: Record<string, unknown>;
|
|
56
|
+
/** Options forwarded to viteReact(). */
|
|
57
|
+
react?: Record<string, unknown>;
|
|
58
|
+
/** Set to false to disable automatic VITE_* env define injection. Default: true. */
|
|
59
|
+
envDefine?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Options for the HMR gate plugin (@lovable.dev/vite-plugin-hmr-gate).
|
|
62
|
+
* Enabled by default in sandbox mode. Set to false to disable, or pass options
|
|
63
|
+
* to customise behaviour. Set to true or an options object to enable outside sandbox.
|
|
64
|
+
*/
|
|
65
|
+
hmrGate?: boolean | Record<string, unknown>;
|
|
65
66
|
}
|
|
66
67
|
declare function defineConfig(config: UserConfig): (env: ConfigEnv) => Promise<UserConfig>;
|
|
67
68
|
declare function defineConfig(config: Promise<UserConfig>): (env: ConfigEnv) => Promise<UserConfig>;
|
|
@@ -69,5 +70,5 @@ declare function defineConfig(config: UserConfigFnObject): (env: ConfigEnv) => P
|
|
|
69
70
|
declare function defineConfig(config: UserConfigFnPromise): (env: ConfigEnv) => Promise<UserConfig>;
|
|
70
71
|
declare function defineConfig(config: UserConfigFn): (env: ConfigEnv) => Promise<UserConfig>;
|
|
71
72
|
declare function defineConfig(options?: LovableViteTanstackOptions): (env: ConfigEnv) => Promise<UserConfig>;
|
|
72
|
-
|
|
73
|
-
export {
|
|
73
|
+
//#endregion
|
|
74
|
+
export { LovableViteTanstackOptions, defineConfig, lovableAssetsProxyPlugin };
|