@lovable.dev/vite-tanstack-config 1.0.0 → 1.1.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 +13 -2
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +13 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -247,9 +247,20 @@ function devServerFnErrorLogger() {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
function defineConfig(
|
|
251
|
-
return async (
|
|
250
|
+
function defineConfig(configOrOptions = {}) {
|
|
251
|
+
return async (env) => {
|
|
252
|
+
const { command, mode } = env;
|
|
252
253
|
const isSandbox = isSandboxEnvironment();
|
|
254
|
+
let options;
|
|
255
|
+
if (typeof configOrOptions === "function") {
|
|
256
|
+
const userConfig = await Promise.resolve(configOrOptions(env));
|
|
257
|
+
options = { vite: userConfig };
|
|
258
|
+
} else if (configOrOptions instanceof Promise) {
|
|
259
|
+
options = { vite: await configOrOptions };
|
|
260
|
+
} else {
|
|
261
|
+
const hasLovableKey = "vite" in configOrOptions || "clientErrorLogger" in configOrOptions || "serverFnErrorLogger" in configOrOptions || "cloudflare" in configOrOptions;
|
|
262
|
+
options = hasLovableKey ? configOrOptions : { vite: configOrOptions };
|
|
263
|
+
}
|
|
253
264
|
const internalPlugins = [];
|
|
254
265
|
const tailwindcss = (await import("@tailwindcss/vite")).default;
|
|
255
266
|
internalPlugins.push(tailwindcss());
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginOption, UserConfig } from 'vite';
|
|
1
|
+
import { PluginOption, UserConfig, ConfigEnv, UserConfigFnObject, UserConfigFnPromise, UserConfigFn } from 'vite';
|
|
2
2
|
|
|
3
3
|
interface LovableViteTanstackOptions {
|
|
4
4
|
plugins?: PluginOption[];
|
|
@@ -7,9 +7,11 @@ interface LovableViteTanstackOptions {
|
|
|
7
7
|
serverFnErrorLogger?: boolean;
|
|
8
8
|
cloudflare?: Record<string, unknown> | false;
|
|
9
9
|
}
|
|
10
|
-
declare function defineConfig(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
declare function defineConfig(config: UserConfig): (env: ConfigEnv) => Promise<UserConfig>;
|
|
11
|
+
declare function defineConfig(config: Promise<UserConfig>): (env: ConfigEnv) => Promise<UserConfig>;
|
|
12
|
+
declare function defineConfig(config: UserConfigFnObject): (env: ConfigEnv) => Promise<UserConfig>;
|
|
13
|
+
declare function defineConfig(config: UserConfigFnPromise): (env: ConfigEnv) => Promise<UserConfig>;
|
|
14
|
+
declare function defineConfig(config: UserConfigFn): (env: ConfigEnv) => Promise<UserConfig>;
|
|
15
|
+
declare function defineConfig(options?: LovableViteTanstackOptions): (env: ConfigEnv) => Promise<UserConfig>;
|
|
14
16
|
|
|
15
17
|
export { type LovableViteTanstackOptions, defineConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginOption, UserConfig } from 'vite';
|
|
1
|
+
import { PluginOption, UserConfig, ConfigEnv, UserConfigFnObject, UserConfigFnPromise, UserConfigFn } from 'vite';
|
|
2
2
|
|
|
3
3
|
interface LovableViteTanstackOptions {
|
|
4
4
|
plugins?: PluginOption[];
|
|
@@ -7,9 +7,11 @@ interface LovableViteTanstackOptions {
|
|
|
7
7
|
serverFnErrorLogger?: boolean;
|
|
8
8
|
cloudflare?: Record<string, unknown> | false;
|
|
9
9
|
}
|
|
10
|
-
declare function defineConfig(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
declare function defineConfig(config: UserConfig): (env: ConfigEnv) => Promise<UserConfig>;
|
|
11
|
+
declare function defineConfig(config: Promise<UserConfig>): (env: ConfigEnv) => Promise<UserConfig>;
|
|
12
|
+
declare function defineConfig(config: UserConfigFnObject): (env: ConfigEnv) => Promise<UserConfig>;
|
|
13
|
+
declare function defineConfig(config: UserConfigFnPromise): (env: ConfigEnv) => Promise<UserConfig>;
|
|
14
|
+
declare function defineConfig(config: UserConfigFn): (env: ConfigEnv) => Promise<UserConfig>;
|
|
15
|
+
declare function defineConfig(options?: LovableViteTanstackOptions): (env: ConfigEnv) => Promise<UserConfig>;
|
|
14
16
|
|
|
15
17
|
export { type LovableViteTanstackOptions, defineConfig };
|
package/dist/index.js
CHANGED
|
@@ -213,9 +213,20 @@ function devServerFnErrorLogger() {
|
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
function defineConfig(
|
|
217
|
-
return async (
|
|
216
|
+
function defineConfig(configOrOptions = {}) {
|
|
217
|
+
return async (env) => {
|
|
218
|
+
const { command, mode } = env;
|
|
218
219
|
const isSandbox = isSandboxEnvironment();
|
|
220
|
+
let options;
|
|
221
|
+
if (typeof configOrOptions === "function") {
|
|
222
|
+
const userConfig = await Promise.resolve(configOrOptions(env));
|
|
223
|
+
options = { vite: userConfig };
|
|
224
|
+
} else if (configOrOptions instanceof Promise) {
|
|
225
|
+
options = { vite: await configOrOptions };
|
|
226
|
+
} else {
|
|
227
|
+
const hasLovableKey = "vite" in configOrOptions || "clientErrorLogger" in configOrOptions || "serverFnErrorLogger" in configOrOptions || "cloudflare" in configOrOptions;
|
|
228
|
+
options = hasLovableKey ? configOrOptions : { vite: configOrOptions };
|
|
229
|
+
}
|
|
219
230
|
const internalPlugins = [];
|
|
220
231
|
const tailwindcss = (await import("@tailwindcss/vite")).default;
|
|
221
232
|
internalPlugins.push(tailwindcss());
|