Add preview mode error handling and update build target configuration
This commit is contained in:
@@ -1683,6 +1683,15 @@ async function requestPlugin(arg:RequestDataArgumentExtended):Promise<requestDat
|
||||
const bias = arg.biasString
|
||||
const v2Function = pluginV2.providers.get(db.currentPluginProvider)
|
||||
|
||||
if(arg.previewBody){
|
||||
return {
|
||||
type: 'success',
|
||||
result: JSON.stringify({
|
||||
error: "Plugin is not supported in preview mode"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const d = v2Function ? (await v2Function(applyParameters({
|
||||
prompt_chat: formated,
|
||||
mode: arg.mode,
|
||||
|
||||
@@ -22,7 +22,6 @@ export default defineConfig(({command, mode}) => {
|
||||
},
|
||||
}),
|
||||
wasm(),
|
||||
topLevelAwait(),
|
||||
command === 'build' ? strip({
|
||||
include: '**/*.(mjs|js|svelte|ts)'
|
||||
}) : null
|
||||
@@ -43,7 +42,7 @@ export default defineConfig(({command, mode}) => {
|
||||
envPrefix: ["VITE_", "TAURI_"],
|
||||
build: {
|
||||
// Tauri supports es2021
|
||||
target:"modules",
|
||||
target:['safari15','chrome100','firefox100','edge100'],
|
||||
// don't minify for debug builds
|
||||
minify: process.env.TAURI_DEBUG ? false : 'esbuild',
|
||||
// produce sourcemaps for debug builds
|
||||
|
||||
Reference in New Issue
Block a user