mirror of
https://github.com/enso-org/enso.git
synced 2024-12-20 07:51:56 +03:00
9fd1ab9092
Generate TS bindings and lazy deserialization for the parser types. # Important Notes - The new API is imported into `ffi.ts`, but not yet used. - I have tested the generated code in isolation, but cannot commit tests as we are not currently able to load WASM modules when running in `vitest`.
67 lines
2.2 KiB
TypeScript
67 lines
2.2 KiB
TypeScript
import vue from '@vitejs/plugin-vue'
|
|
import { fileURLToPath } from 'node:url'
|
|
import postcssNesting from 'postcss-nesting'
|
|
import tailwindcss from 'tailwindcss'
|
|
import tailwindcssNesting from 'tailwindcss/nesting'
|
|
import { defineConfig, type Plugin } from 'vite'
|
|
import topLevelAwait from 'vite-plugin-top-level-await'
|
|
import * as tailwindConfig from '../ide-desktop/lib/dashboard/tailwind.config'
|
|
import { createGatewayServer } from './ydoc-server'
|
|
const projectManagerUrl = 'ws://127.0.0.1:30535'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
cacheDir: '../../node_modules/.cache/vite',
|
|
plugins: [vue(), gatewayServer(), topLevelAwait()],
|
|
optimizeDeps: {
|
|
entries: 'index.html',
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
shared: fileURLToPath(new URL('./shared', import.meta.url)),
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
events$: fileURLToPath(new URL('./shared/events.ts', import.meta.url)),
|
|
},
|
|
},
|
|
define: {
|
|
REDIRECT_OVERRIDE: JSON.stringify('http://localhost:8080'),
|
|
PROJECT_MANAGER_URL: JSON.stringify(projectManagerUrl),
|
|
IS_DEV_MODE: JSON.stringify(process.env.NODE_ENV !== 'production'),
|
|
CLOUD_ENV:
|
|
process.env.ENSO_CLOUD_ENV != null ? JSON.stringify(process.env.ENSO_CLOUD_ENV) : 'undefined',
|
|
RUNNING_VITEST: false,
|
|
'import.meta.vitest': false,
|
|
// Single hardcoded usage of `global` in by aws-amplify.
|
|
'global.TYPED_ARRAY_SUPPORT': true,
|
|
},
|
|
assetsInclude: ['**/*.yaml', '**/*.svg'],
|
|
css: {
|
|
postcss: {
|
|
plugins: [tailwindcssNesting(postcssNesting()), tailwindcss({ config: tailwindConfig })],
|
|
},
|
|
},
|
|
build: {
|
|
// dashboard chunk size is larger than the default warning limit
|
|
chunkSizeWarningLimit: 700,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
fontawesome: ['@fortawesome/react-fontawesome', '@fortawesome/free-brands-svg-icons'],
|
|
'aws-amplify': ['@aws-amplify/core', '@aws-amplify/auth'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|
|
function gatewayServer(): Plugin {
|
|
return {
|
|
name: 'gateway-server',
|
|
configureServer(server) {
|
|
if (server.httpServer == null) return
|
|
|
|
createGatewayServer(server.httpServer)
|
|
},
|
|
}
|
|
}
|