|
|
|
|
|
by lamlam
3208 days ago
|
|
Yes. What you should do is use an asynchronous module loader. There are many small standalone ones like loadjs [1]. But the more widely used tools such as webpack also suppprt this as code splitting [2]. In general you want to avoid sync loads of js assets because depending on how the server serving the asset hangs it can cause the webpage to hang as well. For example, if the server responds with a 404 right away then there are no problems. But if the server does not respond and leaves the connection open the browser will just wait the max time. [1] https://github.com/muicss/loadjs/blob/master/README.md [2] https://webpack.js.org/guides/code-splitting/ |
|