Add an npm package on the server only

I was wondering if there was an obvious answer to this question: Is there a way to add an npm package, which is only loaded into the server, and never on the client (i.e. to avoid the bundle size increase)?

Is it as simple as only importing it inside a server/xxx file?

1 Like

Yes, it’s that simple.

1 Like