ssr.noExternal option — any downsides? #112
-
I'm thinking about using the Plus, later you do not have to think when installing yet another dependency — is this a dev-only dependency or maybe I need it in production. So, another pro — convenience. But are there any downsides? Any significant impact to a dev-server mode, build, and — the most important — a production mode. Does having external dependencies really provide advantages? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It definitely makes things easier when you deploy to prod. However, Vite's bundling is not perfect (I think it's marked as experimental, together with all the SSR stuff). It has issues with some dependencies such as Other than that, as far as I understand, Vite would wrap your CommonJS modules in some extra code, making it slightly slower to load compared to a raw This wouldn't affect the dev server because Vite only bundles during build. So I would say, try to bundle your app and if it works, go for it 👍 -- If you have e2e/integration tests, I would run them against the built app rather than against a dev server so you make sure the bundling is not breaking anything. |
Beta Was this translation helpful? Give feedback.
-
Thanks! Very appreciate your answer! |
Beta Was this translation helpful? Give feedback.
It definitely makes things easier when you deploy to prod. However, Vite's bundling is not perfect (I think it's marked as experimental, together with all the SSR stuff). It has issues with some dependencies such as
aws-sdk
, etc. and this can change in any Vite update.Other than that, as far as I understand, Vite would wrap your CommonJS modules in some extra code, making it slightly slower to load compared to a raw
require
in Node. But the runtime should be similar.This wouldn't affect the dev server because Vite only bundles during build.
So I would say, try to bundle your app and if it works, go for it 👍
-- If you have e2e/integration tests, I would run them against the built app rat…