frandiox / vite-ssr

Use Vite for server side rendering in Node
MIT License
823 stars 91 forks source link

How to disable vite plugin when SSR bundle is building? #167

Closed yuriifabirovskyi closed 2 years ago

yuriifabirovskyi commented 2 years ago

I use vite-plugin-sentry to upload source maps to Sentry. But because there are two different builds for client and for SSR, the source maps are uploaded twice.

yuriifabirovskyi commented 2 years ago

I found solution. I can overwrite plugin configuration and disable it when ssr is building. plugins: [{ ...sentryPlugin(), apply (config, { command }) { return command === 'build' && !config.build.ssr }, }] I think, I need to create issue for vite-plugin-sentry to change plugin configuration globally.