Files
windmill/frontend/vite.config.js
HugoCasa d4345fb02c feat(frontend): generate scripts in the flow and app builders (#1886)
* feat: add inline code gen flow

* feat(frontend): add script gen to flow and app builders

* fix(backend): allow all users to use openai

* Fix build

* Fix build

* Fix build

---------

Co-authored-by: Faton Ramadani <faton.ramadani14@gmail.com>
2023-07-18 12:55:35 +02:00

51 lines
1.1 KiB
JavaScript

import { sveltekit } from '@sveltejs/kit/vite'
import { readFileSync } from 'fs'
import { fileURLToPath } from 'url'
import ViteYaml from '@modyfi/vite-plugin-yaml'
const file = fileURLToPath(new URL('package.json', import.meta.url))
const json = readFileSync(file, 'utf8')
const version = JSON.parse(json)
/** @type {import('vite').UserConfig} */
const config = {
server: {
port: 3000,
proxy: {
'^/api/.*': {
target: process.env.REMOTE ?? 'https://app.windmill.dev/',
changeOrigin: true,
cookieDomainRewrite: 'localhost'
},
'^/ws/.*': {
target: process.env.REMOTE_LSP ?? 'https://app.windmill.dev',
changeOrigin: true,
ws: true
},
'^/ws_mp/.*': {
target: process.env.REMOTE_MP ?? 'https://app.windmill.dev',
changeOrigin: true,
ws: true
}
}
},
preview: {
port: 3000
},
plugins: [sveltekit(), ViteYaml()],
define: {
__pkg__: version
},
optimizeDeps: {
include: ['highlight.js', 'highlight.js/lib/core']
},
resolve: {
alias: {
path: 'path-browserify'
}
},
assetsInclude: ['**/*.wasm']
}
export default config