@leadconnector/vite-tanstack-config 0.2.0-beta.0 → 0.3.0-beta.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/README.md +63 -0
- package/dist/index.cjs +869 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +872 -27
- package/dist/index.js.map +1 -1
- package/package.json +8 -5
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @leadconnector/vite-tanstack-config
|
|
2
|
+
|
|
3
|
+
Shared Vite configuration for LeadConnector TanStack Start previews.
|
|
4
|
+
Requires Vite 7 or 8, matching the supported `@tanstack/react-start` peer.
|
|
5
|
+
The standalone tagger, HMR gate, and dev-server bridge packages continue to
|
|
6
|
+
support Vite 5 through 8.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { defineConfig } from "@leadconnector/vite-tanstack-config";
|
|
12
|
+
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
hmrGate: true,
|
|
15
|
+
devServerBridge: true,
|
|
16
|
+
vite: {
|
|
17
|
+
// Any Vite UserConfig fields.
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`defineConfig` also accepts a plain Vite config, a Vite config function, or a
|
|
23
|
+
promise:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
export default defineConfig(({ mode }) => ({
|
|
27
|
+
base: mode === "development" ? "/" : "/app/",
|
|
28
|
+
}));
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Sandbox behavior
|
|
32
|
+
|
|
33
|
+
A sandbox is detected with `VIBE_SANDBOX=1`, `LOVABLE_SANDBOX=1`, or
|
|
34
|
+
`DEV_SERVER__PROJECT_PATH`.
|
|
35
|
+
|
|
36
|
+
- The HMR gate and dev-server bridge are enabled for `serve` unless explicitly
|
|
37
|
+
set to `false`. Outside a sandbox they require `true` or an options object.
|
|
38
|
+
- Sandbox networking is fixed to host `::`, port `8080`, and strict port mode.
|
|
39
|
+
HMR overlays are disabled when HMR is enabled; an explicit
|
|
40
|
+
`server.hmr: false` remains disabled.
|
|
41
|
+
- `server.headers`, custom `server.cors`, and `server.proxy` are warned about
|
|
42
|
+
and removed.
|
|
43
|
+
- `allowedHosts` is never set to `true` and always includes `.modal.host` for
|
|
44
|
+
secure Modal tunnel previews. Add other preview hostnames with
|
|
45
|
+
`VIBE_PREVIEW_HOST` (one URL/hostname) or `VIBE_PREVIEW_HOSTS`
|
|
46
|
+
(comma-separated); invalid values are rejected.
|
|
47
|
+
|
|
48
|
+
Bundled dev is disabled by default. It is enabled only for sandbox `serve`
|
|
49
|
+
when `VIBE_FEATURE_BUNDLED_DEV=true` and the installed Vite is a stable
|
|
50
|
+
version at least 8.1. Unsupported, prerelease, and unresolved versions warn
|
|
51
|
+
and use classic dev.
|
|
52
|
+
|
|
53
|
+
## Options
|
|
54
|
+
|
|
55
|
+
- `hmrGate`: `boolean | HmrGateOptions`
|
|
56
|
+
- `devServerBridge`: `boolean | DevServerBridgeOptions`
|
|
57
|
+
- `ssrErrorLogger` / `serverFnErrorLogger`: set to `false` to disable the
|
|
58
|
+
corresponding platform diagnostics
|
|
59
|
+
- `envDefine`: set to `false` to omit loaded `VITE_` definitions
|
|
60
|
+
- `nitro`: opt in outside a sandbox with `true` or an options object; sandbox
|
|
61
|
+
builds retain the package's existing required Nitro policy
|
|
62
|
+
- `tanstackStart`, `react`, `plugins`, and `vite`: additional plugin/config
|
|
63
|
+
options merged with the internal defaults
|