Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"scripts": {
"dev": "vue-tsc -b && vite",
"build": "vue-tsc -b &&NODE_OPTIONS=--max_old_space_size=4096 vite build",
"build:modern": "vue-tsc -b && SQLBOT_LEGACY=false NODE_OPTIONS=--max_old_space_size=4096 vite build",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix"
},
Expand Down
17 changes: 12 additions & 5 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import legacy from '@vitejs/plugin-legacy'

export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
// Opt out with SQLBOT_LEGACY=false (npm run build:modern) to skip the
// duplicate Babel/legacy bundle, which dominates build time and memory.
const withLegacy = process.env.SQLBOT_LEGACY !== 'false'
console.info(mode)
console.info(env)
return {
Expand All @@ -28,11 +31,15 @@ export default defineConfig(({ mode }) => {
svgo: false,
defaultImport: 'component', // or 'raw'
}),
legacy({
targets: ['Chrome >= 81'],
polyfills: true,
modernPolyfills: true,
}),
...(withLegacy
? [
legacy({
targets: ['Chrome >= 81'],
polyfills: true,
modernPolyfills: true,
}),
]
: []),
],
resolve: {
alias: {
Expand Down
Loading