@lovable.dev/vite-tanstack-config 2.24.0 → 2.25.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 +1 -58
- package/dist/index.js +1 -58
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -103,58 +103,9 @@ function lovableAssetsProxyPlugin() {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
|
-
//#region src/bundledDev.ts
|
|
107
|
-
const BUNDLED_DEV_ENV_VAR = "LOVABLE_FEATURE_BUNDLED_DEV";
|
|
108
|
-
function bundledDevRequested() {
|
|
109
|
-
return process.env[BUNDLED_DEV_ENV_VAR] === "true";
|
|
110
|
-
}
|
|
111
|
-
function viteVersionSupportsBundledDev(version) {
|
|
112
|
-
if (!version || version.includes("-")) return false;
|
|
113
|
-
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
|
|
114
|
-
if (!match) return false;
|
|
115
|
-
const [major, minor] = [Number(match[1]), Number(match[2])];
|
|
116
|
-
return major === 8 && minor === 1;
|
|
117
|
-
}
|
|
118
|
-
async function resolveInstalledViteVersion() {
|
|
119
|
-
try {
|
|
120
|
-
const { createRequire } = await import("node:module");
|
|
121
|
-
const { version } = createRequire(`${process.cwd()}/package.json`)("vite/package.json");
|
|
122
|
-
return typeof version === "string" ? version : void 0;
|
|
123
|
-
} catch {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/bundledDevCssUrlShim.ts
|
|
129
|
-
const VIRTUAL_PREFIX = "\0lovable-bundled-dev-css-url:";
|
|
130
|
-
const VIRTUAL_SUFFIX = ".shim.js";
|
|
131
|
-
function bundledDevCssUrlShim() {
|
|
132
|
-
return {
|
|
133
|
-
name: "lovable-bundled-dev-css-url-shim",
|
|
134
|
-
apply: "serve",
|
|
135
|
-
enforce: "pre",
|
|
136
|
-
async resolveId(id, importer) {
|
|
137
|
-
if (!id.endsWith(".css?url")) return null;
|
|
138
|
-
const resolved = await this.resolve(id.slice(0, -4), importer, { skipSelf: true });
|
|
139
|
-
if (!resolved) return null;
|
|
140
|
-
return VIRTUAL_PREFIX + resolved.id + VIRTUAL_SUFFIX;
|
|
141
|
-
},
|
|
142
|
-
load(id) {
|
|
143
|
-
if (!id.startsWith(VIRTUAL_PREFIX) || !id.endsWith(VIRTUAL_SUFFIX)) return null;
|
|
144
|
-
const file = id.slice(29, -8);
|
|
145
|
-
const inlineSpecifier = file.includes("?") ? `${file}&inline` : `${file}?inline`;
|
|
146
|
-
return [
|
|
147
|
-
`import css from ${JSON.stringify(inlineSpecifier)};`,
|
|
148
|
-
`const b64 = typeof Buffer !== "undefined" ? Buffer.from(css, "utf8").toString("base64") : btoa(unescape(encodeURIComponent(css)));`,
|
|
149
|
-
`export default "data:text/css;base64," + b64;`
|
|
150
|
-
].join("\n");
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
//#endregion
|
|
155
106
|
//#region package.json
|
|
156
107
|
var name = "@lovable.dev/vite-tanstack-config";
|
|
157
|
-
var version = "2.
|
|
108
|
+
var version = "2.25.1";
|
|
158
109
|
//#endregion
|
|
159
110
|
//#region src/logging.ts
|
|
160
111
|
const PACKAGE_NAME = "@lovable.dev/vite-tanstack-config";
|
|
@@ -1938,14 +1889,6 @@ function defineConfig(configOrOptions = {}) {
|
|
|
1938
1889
|
plugins: [...internalPlugins, ...options.plugins ?? []]
|
|
1939
1890
|
};
|
|
1940
1891
|
if (options.vite) config = (0, vite.mergeConfig)(config, options.vite);
|
|
1941
|
-
if (command === "serve" && isSandbox && bundledDevRequested()) {
|
|
1942
|
-
const viteVersion = await resolveInstalledViteVersion();
|
|
1943
|
-
if (viteVersionSupportsBundledDev(viteVersion)) config = (0, vite.mergeConfig)(config, {
|
|
1944
|
-
experimental: { bundledDev: true },
|
|
1945
|
-
plugins: [bundledDevCssUrlShim()]
|
|
1946
|
-
});
|
|
1947
|
-
else logWarning(`Bundled dev requested (${BUNDLED_DEV_ENV_VAR}) but the installed vite (${viteVersion ?? "unresolved"}) is outside the supported 8.1.x range — starting classic dev.`);
|
|
1948
|
-
}
|
|
1949
1892
|
if (isSandbox) {
|
|
1950
1893
|
validateConfig(config);
|
|
1951
1894
|
config = cleanServerConfig((0, vite.mergeConfig)(config, { server: {
|
package/dist/index.js
CHANGED
|
@@ -79,58 +79,9 @@ function lovableAssetsProxyPlugin() {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
|
-
//#region src/bundledDev.ts
|
|
83
|
-
const BUNDLED_DEV_ENV_VAR = "LOVABLE_FEATURE_BUNDLED_DEV";
|
|
84
|
-
function bundledDevRequested() {
|
|
85
|
-
return process.env[BUNDLED_DEV_ENV_VAR] === "true";
|
|
86
|
-
}
|
|
87
|
-
function viteVersionSupportsBundledDev(version) {
|
|
88
|
-
if (!version || version.includes("-")) return false;
|
|
89
|
-
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
|
|
90
|
-
if (!match) return false;
|
|
91
|
-
const [major, minor] = [Number(match[1]), Number(match[2])];
|
|
92
|
-
return major === 8 && minor === 1;
|
|
93
|
-
}
|
|
94
|
-
async function resolveInstalledViteVersion() {
|
|
95
|
-
try {
|
|
96
|
-
const { createRequire } = await import("node:module");
|
|
97
|
-
const { version } = createRequire(`${process.cwd()}/package.json`)("vite/package.json");
|
|
98
|
-
return typeof version === "string" ? version : void 0;
|
|
99
|
-
} catch {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/bundledDevCssUrlShim.ts
|
|
105
|
-
const VIRTUAL_PREFIX = "\0lovable-bundled-dev-css-url:";
|
|
106
|
-
const VIRTUAL_SUFFIX = ".shim.js";
|
|
107
|
-
function bundledDevCssUrlShim() {
|
|
108
|
-
return {
|
|
109
|
-
name: "lovable-bundled-dev-css-url-shim",
|
|
110
|
-
apply: "serve",
|
|
111
|
-
enforce: "pre",
|
|
112
|
-
async resolveId(id, importer) {
|
|
113
|
-
if (!id.endsWith(".css?url")) return null;
|
|
114
|
-
const resolved = await this.resolve(id.slice(0, -4), importer, { skipSelf: true });
|
|
115
|
-
if (!resolved) return null;
|
|
116
|
-
return VIRTUAL_PREFIX + resolved.id + VIRTUAL_SUFFIX;
|
|
117
|
-
},
|
|
118
|
-
load(id) {
|
|
119
|
-
if (!id.startsWith(VIRTUAL_PREFIX) || !id.endsWith(VIRTUAL_SUFFIX)) return null;
|
|
120
|
-
const file = id.slice(29, -8);
|
|
121
|
-
const inlineSpecifier = file.includes("?") ? `${file}&inline` : `${file}?inline`;
|
|
122
|
-
return [
|
|
123
|
-
`import css from ${JSON.stringify(inlineSpecifier)};`,
|
|
124
|
-
`const b64 = typeof Buffer !== "undefined" ? Buffer.from(css, "utf8").toString("base64") : btoa(unescape(encodeURIComponent(css)));`,
|
|
125
|
-
`export default "data:text/css;base64," + b64;`
|
|
126
|
-
].join("\n");
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
//#endregion
|
|
131
82
|
//#region package.json
|
|
132
83
|
var name = "@lovable.dev/vite-tanstack-config";
|
|
133
|
-
var version = "2.
|
|
84
|
+
var version = "2.25.1";
|
|
134
85
|
//#endregion
|
|
135
86
|
//#region src/logging.ts
|
|
136
87
|
const PACKAGE_NAME = "@lovable.dev/vite-tanstack-config";
|
|
@@ -1914,14 +1865,6 @@ function defineConfig(configOrOptions = {}) {
|
|
|
1914
1865
|
plugins: [...internalPlugins, ...options.plugins ?? []]
|
|
1915
1866
|
};
|
|
1916
1867
|
if (options.vite) config = mergeConfig(config, options.vite);
|
|
1917
|
-
if (command === "serve" && isSandbox && bundledDevRequested()) {
|
|
1918
|
-
const viteVersion = await resolveInstalledViteVersion();
|
|
1919
|
-
if (viteVersionSupportsBundledDev(viteVersion)) config = mergeConfig(config, {
|
|
1920
|
-
experimental: { bundledDev: true },
|
|
1921
|
-
plugins: [bundledDevCssUrlShim()]
|
|
1922
|
-
});
|
|
1923
|
-
else logWarning(`Bundled dev requested (${BUNDLED_DEV_ENV_VAR}) but the installed vite (${viteVersion ?? "unresolved"}) is outside the supported 8.1.x range — starting classic dev.`);
|
|
1924
|
-
}
|
|
1925
1868
|
if (isSandbox) {
|
|
1926
1869
|
validateConfig(config);
|
|
1927
1870
|
config = cleanServerConfig(mergeConfig(config, { server: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovable.dev/vite-tanstack-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.1",
|
|
4
4
|
"description": "Vite config wrapper for Lovable TanStack Start projects",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@tailwindcss/vite": "^4.3.0",
|
|
85
85
|
"@tanstack/react-query": "^5.102.8",
|
|
86
|
-
"@tanstack/react-router": "1.170.
|
|
87
|
-
"@tanstack/react-start": "^1.
|
|
88
|
-
"@tanstack/router-generator": "^1.167.
|
|
86
|
+
"@tanstack/react-router": "1.170.38",
|
|
87
|
+
"@tanstack/react-start": "^1.168.57",
|
|
88
|
+
"@tanstack/router-generator": "^1.167.38",
|
|
89
89
|
"@types/node": "22.13.13",
|
|
90
90
|
"@vitejs/plugin-react": "^5.2.0",
|
|
91
91
|
"nitro": "3.0.260603-beta",
|