简体   繁体   中英

How to prepare KOA / Node.js for production?

I am using mostly React,

and there is a build directory, that will be deployed in the server. It contains minifyed files and excludes development dependancies.

So my question is - is it advisable or best practice at all to bundle also the same way KOA/NodeJS framework that is serving the server?

Front-end scripts are often minified and bundled because loading every file on every page load is wasteful and slow. It is more efficient to transfer a single large file than many small ones, although this is different in some cases under HTTP2.

Your Koa app is server side. Files are loaded from disk once when your app starts. Both of these contribute to it making no sense to make a bundle out of your code and dependencies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM