Next.js Discord

Discord Forum

Impact of library on Production

Answered
Asian black bear posted this in #help-forum
Open in Discord
Avatar
Asian black bearOP
How to decide the impact of size of a library on production of a web app ? (using next js 13.5.2)

- will the production build will be reduced if it's in dev-dependency and not in dependencies ?
- if it's in dependencies but no where in the app it's importd (import {foo} from bar;), will the production build will include the library ?
- difference between npm i foo vs npm install foo --save, how it impact size of production ?
- say i've a library foo in depnedency list and it's used in "/amigo" route/file , will the web app will load the library before i visit "/amigo" route of only load the library after i visit "/amigo"
Answered by joulev & fuma pray for Schneider
* no difference
* no
* no difference
* only /amigo bundle js files have the foo library, so it won’t impact the load time of other routes
View full answer

4 Replies

Avatar
joulev & fuma pray for Schneider
* no difference
* no
* no difference
* only /amigo bundle js files have the foo library, so it won’t impact the load time of other routes
Answer
Avatar
Asian black bearOP
ok, 1st one will have no difference ?
Avatar
joulev & fuma pray for Schneider
No difference between dependencies and devDependencies for the dependencies of a Next.js application
Avatar
Asian black bearOP
ok