异步模块是否总是异步的? [英] Are Asynchronous Modules Always Asynchronous?

查看:94
本文介绍了异步模块是否总是异步的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当多个JavaScript模块使用AMD define()'d并连接到一个文件中时,那些模块是否仍被认为是异步的?

When multiple JavaScript modules are define()'d using AMD and concatenated into a single file, are those modules still considered asynchronous?

推荐答案

是的,它们仍然被认为是异步的.

Yes, they are still considered async.

虽然不必从磁盘上加载模块本身,但确实需要执行模块并进行回叫.

While the module itself doesn't have to be loaded from disk, the modules do need to be executed and there is a call back made.

因为您可以将 Some 模块组合到一个文件中,但这并不意味着您必须将所有模块组合在一起-RequireJS也不会在其中假设所有模块.

Because you can combine SOME modules into a single file doesn't mean you have to combine all -- nor does RequireJS assume all there.

它将运行您的预加载中的内容,并异步加载其余内容.

It will run what it can from your preload and async load the rest.

这篇关于异步模块是否总是异步的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆