mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-14 02:20:12 +01:00
1846a99b93
* WIP embedded app * WIP got response from backend in embedded app * WIP streaming prints to embedded app * implemented streaming and tailwind min for styling into embedded app * WIP embedded app history functional * load params from script tag into embedded app * rough in modularization of embed chat cleanup dev process for easier dev support move all chat to components todo: build process todo: backend support * remove eslint config * Implement models and cleanup embed chat endpoints Improve build process for embed prod minification and bundle size awareness WIP * forgot files * rename to embed folder * introduce chat modal styles * add middleware validations on embed chat * auto open param and default greeting * reset chat history * Admin embed config page * Admin Embed Chats mgmt page * update embed * nonpriv * more style support reopen if chat was last opened * update comments * remove unused imports * allow change of workspace for embedconfig * update failure to lookup message * update reset script * update instructions * Add more styling options Add sponsor text at bottom Support dynamic container height Loading animations * publish new embed script * Add back syntax highlighting and keep bundle small via dynamic script build * add hint * update readme * update copy model for snippet with link to styles --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
65 lines
1.5 KiB
JavaScript
65 lines
1.5 KiB
JavaScript
// vite.config.js
|
|
import { defineConfig } from "vite"
|
|
import { fileURLToPath, URL } from "url"
|
|
import react from "@vitejs/plugin-react"
|
|
import image from "@rollup/plugin-image"
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), image()],
|
|
define: {
|
|
// In dev, we need to disable this, but in prod, we need to enable it
|
|
"process.env.NODE_ENV": JSON.stringify("production")
|
|
},
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: "@",
|
|
replacement: fileURLToPath(new URL("./src", import.meta.url))
|
|
},
|
|
{
|
|
process: "process/browser",
|
|
stream: "stream-browserify",
|
|
zlib: "browserify-zlib",
|
|
util: "util",
|
|
find: /^~.+/,
|
|
replacement: (val) => {
|
|
return val.replace(/^~/, "")
|
|
}
|
|
}
|
|
]
|
|
},
|
|
build: {
|
|
lib: {
|
|
entry: "src/main.jsx",
|
|
name: "EmbeddedAnythingLLM",
|
|
formats: ["umd"],
|
|
fileName: (_format) => `anythingllm-chat-widget.js`
|
|
},
|
|
rollupOptions: {
|
|
external: [
|
|
// Reduces transformation time by 50% and we don't even use this variant, so we can ignore.
|
|
/@phosphor-icons\/react\/dist\/ssr/,
|
|
]
|
|
},
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true
|
|
},
|
|
cssCodeSplit: false,
|
|
assetsInlineLimit: 100000000,
|
|
minify: "esbuild",
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
inlineDynamicImports: true,
|
|
assetsDir: "",
|
|
sourcemap: 'inline',
|
|
},
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
define: {
|
|
global: "globalThis"
|
|
},
|
|
plugins: []
|
|
}
|
|
},
|
|
})
|