Fix API playground not loading (#10891)
The @scalar package we use to offer a REST api playground is quite heavy (3k files compared to the 15k existing) and is not pre-build in the npm package, which is not unusual. This is increasing the memory need during vite build. I'm increasing the RAM available for vite build. Long term I recommend using a CDN here as this is not really a React component so we won't benefit from any reactivity anyway. Exaclty like we have done for FrontApp support chat integration <img width="1058" alt="image" src="https://github.com/user-attachments/assets/5412c6c1-7434-4b19-b9ac-e89f1cb614f3" />
This commit is contained in:
@ -146,7 +146,15 @@ export default defineConfig(({ command, mode }) => {
|
||||
outDir: 'build',
|
||||
sourcemap: VITE_BUILD_SOURCEMAP === 'true',
|
||||
rollupOptions: {
|
||||
external: ['@scalar/api-reference-react'],
|
||||
output: {
|
||||
manualChunks: (id: string) => {
|
||||
if (id.includes('@scalar')) {
|
||||
return 'scalar';
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user