mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
improved module manager's secrets extraction, updated plugins
This commit is contained in:
@@ -50,16 +50,22 @@ export function withPlatformProxy<Env extends CloudflareEnv>(
|
||||
// @ts-ignore
|
||||
app: async (_env) => {
|
||||
const env = await getEnv(_env);
|
||||
const binding = use_proxy ? getBinding(env, "D1Database") : undefined;
|
||||
|
||||
if (config?.app === undefined && use_proxy) {
|
||||
const binding = getBinding(env, "D1Database");
|
||||
if (config?.app === undefined && use_proxy && binding) {
|
||||
return {
|
||||
connection: d1Sqlite({
|
||||
binding: binding.value,
|
||||
}),
|
||||
};
|
||||
} else if (typeof config?.app === "function") {
|
||||
return config?.app(env);
|
||||
const appConfig = await config?.app(env);
|
||||
if (binding) {
|
||||
appConfig.connection = d1Sqlite({
|
||||
binding: binding.value,
|
||||
}) as any;
|
||||
}
|
||||
return appConfig;
|
||||
}
|
||||
return config?.app || {};
|
||||
},
|
||||
|
||||
@@ -24,7 +24,9 @@ export function devFsVitePlugin({
|
||||
projectRoot = config.root;
|
||||
},
|
||||
configureServer(server) {
|
||||
if (!isDev) return;
|
||||
if (!isDev) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Intercept stdout to watch for our write requests
|
||||
const originalStdoutWrite = process.stdout.write;
|
||||
@@ -78,7 +80,10 @@ export function devFsVitePlugin({
|
||||
// @ts-ignore
|
||||
transform(code, id, options) {
|
||||
// Only transform in SSR mode during development
|
||||
if (!isDev || !options?.ssr) return;
|
||||
//if (!isDev || !options?.ssr) return;
|
||||
if (!isDev) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if this is the bknd config file
|
||||
if (id.includes(configFile)) {
|
||||
|
||||
Reference in New Issue
Block a user